当我尝试将只读 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();
任何人都可以帮我解决这个问题。