当我试图将只读ppt / pptx保存到pdf时我得到了一个msg,如下所示
下面是我的代码:
Microsoft.Office.Interop.PowerPoint.Application pptApplication = new Microsoft.Office.Interop.PowerPoint.Application();
pptApplication.DisplayAlerts = PpAlertLevel.ppAlertsNone;
Microsoft.Office.Interop.PowerPoint.Presentation pptPresentation = pptApplication.Presentations.Open("E:\\Share Box\\data.pptx", MsoTriState.msoTriStateMixed,
MsoTriState.msoFalse, MsoTriState.msoFalse);
string temp = pptPresentation.ReadOnly.ToString();
pptPresentation.SaveAs("E:\\Share Box\\"+DateTime.Now.Second.ToString(), PpSaveAsFileType.ppSaveAsPDF, MsoTriState.msoTrue);
pptPresentation.Close();
Marshal.FinalReleaseComObject(pptPresentation);
pptPresentation = null;
pptApplication.Quit();
Marshal.FinalReleaseComObject(pptApplication);
pptApplication = null;
GC.Collect();
任何人都可以帮我解决这个问题。
答案 0 :(得分:0)
我尝试了这段代码并且工作正常。为此,我使用了从中下载的互操作程序集 http://www.microsoft.com/en-in/download/details.aspx?id=3508
请同时查看