Preview of Power Point in Sharepoint 2013

0

I am developing a web part using share point 2013 and Visual Studio 2013.I have to display the preview of a power point file(also excel and word files).Preview is working fine for .pdf files.So my idea is to convert ppt file to pdf file and then display the preview.Please see my code.

      Microsoft.Office.Interop.PowerPoint._Application PPApplication = new      Application();
      Presentation PPDoc = null;
      PPDoc = PPApplication.Presentations.Open(InputFilePath);   
      PPDoc.SaveAs(OutputFilePath, PpSaveAsFileType.ppSaveAsPDF);

But the first line of code to create an object generated following error. Retrieving the COM class factory for component with CLSID {91493441-5A91-11CF-8700-00AA0060263B} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) Then I followed steps in the link below. "Retrieving the COM class factory for component.... error: 80070005 Access is denied." (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) Then the error changed which is given below. Retrieving the COM class factory for component with CLSID {91493441-5A91-11CF-8700-00AA0060263B} failed due to the following error: 80010001 Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED)). How can I solve this issue.Please help me.Thanks in advance

sharepoint
com
asked on Stack Overflow Jun 4, 2015 by Ajith Kumar.M • edited May 23, 2017 by Community

1 Answer

0

I got a similar error from a webapp using a webservice on a local server. My webservice is writing to disk and this error occured because the application pool running my webservice did not have the proper read/write permissions.

answered on Stack Overflow Jul 22, 2015 by niho • edited Jul 22, 2015 by Glorfindel

User contributions licensed under CC BY-SA 3.0