【问题标题】:COMException (0x80004005): Slides (unknown member) : Failed thrown in InsertFromFile methodCOMException(0x80004005):幻灯片(未知成员):InsertFromFile 方法中抛出失败
【发布时间】:2019-08-23 12:55:56
【问题描述】:

我正在使用Microsoft Interop library 处理PowerPoint 演示文稿。通过 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)

对为什么会发生这种情况有任何想法吗?

【问题讨论】:

  • 只需谷歌“powerpoint insertfromfile failed”即可找到其他受害者。它具有“运行时错误 0”失败的诀窍,这肯定是造成悲惨的“失败”诊断的原因。

标签: interop powerpoint


【解决方案1】:

文件路径指向的 PowerPoint 不存在。请务必检查路径并确保它指向您要使用的文件。我建议准确地按照路径查看它的路径并确保文件存在于那里。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-01-18
    • 1970-01-01
    • 1970-01-01
    • 2016-10-05
    • 2013-07-28
    • 1970-01-01
    • 1970-01-01
    • 2015-04-21
    相关资源
    最近更新 更多