Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/279.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# 保存.pptx文件时获取异常_C#_Office Interop_Com Interop - Fatal编程技术网

C# 保存.pptx文件时获取异常

C# 保存.pptx文件时获取异常,c#,office-interop,com-interop,C#,Office Interop,Com Interop,我有一个演示对象,如下所示 using Presentation = Microsoft.Office.Interop.PowerPoint.Presentation; Presentation pptPresentation = pptApplication.Presentations.Add(MsoTriState.msoFalse); 经过一些处理后,在保存时 pptPresentation.SaveAs(@"c:\temp\myPPT.pptx", Microsoft.Office.I

我有一个演示对象,如下所示

using Presentation = Microsoft.Office.Interop.PowerPoint.Presentation;
Presentation pptPresentation = pptApplication.Presentations.Add(MsoTriState.msoFalse);
经过一些处理后,在保存时

pptPresentation.SaveAs(@"c:\temp\myPPT.pptx", Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType.ppSaveAsDefault, MsoTriState.msoTrue);
它抛出了一个异常

我将非常感谢任何人的帮助,这让我很难堪


环境详细信息:-Windows 2008 Server(x64)、.NET 3.5、IIS7

最终我得到了神奇的解决方案

我刚刚在Windows 2008服务器中创建了两个文件夹

C:\Windows\SysWOW64\config\systemprofile\Desktop和 C:\Windows\System32\config\systemprofile\Desktop

对文件夹应用读取权限后,ppt将保存在服务器的本地目录中。

错误代码是什么?是的,这些步骤对我也适用。我也给了IIS用户权限。