首页 > 解决方案 > COMException(0x80004005):幻灯片(未知成员):InsertFromFile 方法中抛出失败

问题描述

我正在使用Microsoft Interop library. 通过 Interop 库方法将幻灯片添加到演示文稿时会引发标题异常。

文件存在,路径正确,索引有效。

inpPre.Slides.InsertFromFile(tmpPathInsert, inpSldCom.SlideIndex);

此代码可以正常工作,以进行大量演示,并在特定幻灯片上引发异常。错误:

System.Runtime.InteropServices.COMException (0x80004005): Slides (unknown member) : Failed.
   at Microsoft.Office.Interop.PowerPoint.Slides.InsertFromFile(String FileName, Int32 Index, Int32 SlideStart, Int32 SlideEnd)

关于为什么会发生这种情况的任何想法?

标签: interoppowerpoint

解决方案


The PowerPoint that the file path is pointing to does not exist. Be sure to check the path and make sure it's pointing to the file you want to use. I recommend following the path exactly to see where it leads and make sure the file exists there.


推荐阅读