【问题标题】:PowerPoint ExportAsFixedFormat exceptionPowerPoint ExportAsFixedFormat 异常
【发布时间】:2010-03-04 20:36:14
【问题描述】:

我在 powerpoint 插件中有这段代码,但它不起作用并给了我一个例外。异常说:

“值不在预期范围内”。

任何想法我做错了什么?

this.Application.ActivePresentation.ExportAsFixedFormat(path,
                    PpFixedFormatType.ppFixedFormatTypeXPS,
                    PpFixedFormatIntent.ppFixedFormatIntentPrint,
                    Microsoft.Office.Core.MsoTriState.msoTrue, 
                    PpPrintHandoutOrder.ppPrintHandoutHorizontalFirst,
                    PpPrintOutputType.ppPrintOutputSlides,
                    Microsoft.Office.Core.MsoTriState.msoTrue,
                    null,
                    PpPrintRangeType.ppPrintAll,
                    null,
                    true, 
                    true, 
                    true, 
                    false, 
                    false, 
                    null 
                    );

【问题讨论】:

    标签: c# ms-office add-in powerpoint


    【解决方案1】:

    尝试将最后一个值设置为“Missing.Value”。这对这里的某人有用:http://msdn.microsoft.com/en-us/library/bb231096.aspx

    【讨论】:

    • 哇,成功了。我一直专注于 PrintRange。谢谢谢谢谢谢。
    • @Alexander Cohen:您可以选择 Nick 的答案并带有复选标记以表明它是正确答案。
    【解决方案2】:

    来自 MSN 文档:http://msdn.microsoft.com/en-us/library/bb231096%28v=office.12%29.aspx

    ((MSPowerPoint.Presentation)this.Document).SaveAs(filename, MSPowerPoint.PpSaveAsFileType.ppSaveAsPDF, MsoTriState.msoCTrue);
    

    【讨论】:

    • 只是用它来获得演示文稿的预览图片(从 .xps 文件中) - 通过 NetOffice 效果很好!没有运行 ExportAsFixedFormat。
    【解决方案3】:

    当路径参数接近 220 个字符时调用 Excels ExportAsFixedFormat 方法时出现此错误。 Windows 中的文件名限制为 260,这很奇怪,但缩短文件名解决了我的问题。

    【讨论】:

      猜你喜欢
      • 2013-07-27
      • 2010-10-27
      • 2017-07-12
      • 2018-07-29
      • 2017-05-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多