【问题标题】:How to save read only ppt to pdf?如何将只读ppt保存为pdf?
【发布时间】:2012-12-03 14:59:04
【问题描述】:

当我尝试将只读 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();

任何人都可以帮我解决这个问题。

【问题讨论】:

    标签: c#-4.0 asp.net-4.0 office-interop


    【解决方案1】:

    我试过这段代码,它工作正常。为此,我使用了从下载的互操作程序集 http://www.microsoft.com/en-in/download/details.aspx?id=3508

    请看这里

    http://support.microsoft.com/kb/873433

    【讨论】:

      猜你喜欢
      • 2021-10-18
      • 1970-01-01
      • 1970-01-01
      • 2016-03-16
      • 2021-01-13
      • 2013-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多