C# PowerPoint ExportAsFixedFormat异常
我在powerpoint加载项中有此代码,但它不起作用,并给我一个异常。例外情况是: “值不在预期范围内” 知道我做错了什么吗C# PowerPoint ExportAsFixedFormat异常,c#,ms-office,add-in,powerpoint,C#,Ms Office,Add In,Powerpoint,我在powerpoint加载项中有此代码,但它不起作用,并给我一个异常。例外情况是: “值不在预期范围内” 知道我做错了什么吗 this.Application.ActivePresentation.ExportAsFixedFormat(path, PpFixedFormatType.ppFixedFormatTypeXPS, PpFixedFormatIntent.ppFixedFormatIntentPrint
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
);
尝试将最后一个值设置为“Missing.value”。这对这里的某个人有用:来自MSN文档:
HIH当path参数接近220个字符时,调用Excels ExportAsFixedFormat方法时,我遇到了这个错误。windows中的文件名限制是260,这很奇怪,但缩短文件名解决了我的问题。Wow,效果不错。我一直在关注印刷品系列。谢谢谢谢。@Alexander Cohen:您可以用复选标记选择Nick的答案,以表明它是正确的答案。只需使用它来获取演示文稿的预览图片(从.xps文件中)-通过NetOffice非常有效!未运行ExportAsFixedFormat。
((MSPowerPoint.Presentation)this.Document).SaveAs(filename, MSPowerPoint.PpSaveAsFileType.ppSaveAsPDF, MsoTriState.msoCTrue);