Powerpoint Interop does not work in a Windows service, but works fine in a Windows Form application

I wrote an application to view a folder, and whenever a PowerPoint document falls into it, it looks at the slides inside it and generates png images of each slide. This works fine in a Windows Forms application, but I put the exact same code into a Windows service, used the same test file, and could not open it with the following error:

Error: PowerPoint could not open the file. at Microsoft.Office.Interop.PowerPoint.Presentations.Open (String FileName, MsoTriState ReadOnly, MsoTriState Untitled, MsoTriState WithWindow) -2147467259 Error Com

I found that the service starts with my own user account (with administrator privileges), so I think this would eliminate permission problems, but I can not think of anything else to try.

Any suggestions?

+3
source share
4 answers

, , . . - XP , , , PP , . PP , , . COM, PP, , - . , ERROR_ACCESS_DENIED, ERROR_OUT_OF_MEMORY .

, PowerPoint - - . . , , . , PowerPoint . Google , , .

+1

" " , ( , ):

Office Windows 2008

( " " " " )

+4
  • > p > p > DCOM.
  • DCOM Microsoft PowerPoint Slide .
  • "" , Network Service/access.

PowerPoint , .

+1
source

Try installing the Service to interact with the desktop.

0
source

Source: https://habr.com/ru/post/1706109/


All Articles