If I want to create a word document in C# using Interop.Word
, I can create the document without ever opening the program:
Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visibile = false;
I'm trying to find an equivalent when using Interop.Powerpoint, but I have been unable to find the appropriate property.
Any help would be much appreciated.
EDIT
Sorry, my question was not clear. I have tried:
Microsoft.Office.Interop.Powerpoint.Application pptApp = new Microsoft.Office.Interop.Powerpoint.Application();
pptApp.Visible = Microsoft.Office.Core.MsoTriState.msoFalse;
However, I received the following error:
Application (unknown member) : Invalid request. Hiding the application window is not allowed.
You can prevent from showing the window while opening the Presentation:
pptApp = new Microsoft.Office.Interop.Powerpoint.Application();
pptApp.Presentations.Open(fileName, WithWindow:Microsoft.Office.Core.MsoTriState.msoFalse);
I know you already utilized Open XML, but maybe someone else will need this.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.