Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# PowerPoint ExportAsFixedFormat异常_C#_Ms Office_Add In_Powerpoint - Fatal编程技术网

C# PowerPoint ExportAsFixedFormat异常

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

我在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 
                    );

尝试将最后一个值设置为“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);