2

読み取り専用のppt/pptxをPDFに保存しようとすると、次のようなメッセージが表示されます。

ここに画像の説明を入力してください

以下は私のコードです:

        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();

誰でも私がこれを修正するのを手伝ってくれるでしょう。

4

1 に答える 1