识别错误

使用问题 · 556 次浏览
cwfwg 创建于 2022-07-25 18:29

无法将类型为“Microsoft.Office.Interop.Word.ApplicationClass”的 COM 对象强制转换为接口类型“Microsoft.Office.Interop.Word._Application”。此操作失败的原因是对 IID 为“{00020970-0000-0000-C000-000000000046}”的接口的 COM 组件调用 QueryInterface 因以下错误而失败: 加载类型库/DLL 时出错。 (异常来自 HRESULT:0x80029C4A (TYPE_E_CANTLOADLIBRARY))。
   在 System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
   在 Microsoft.Office.Interop.Word.ApplicationClass.get_ActiveDocument()
   在 Cesar.Office.Interop.FunctionWord.转换当前文档中选中的LaTeX公式() 位置 G:\笔记本\04-Code\CSharp\01-Office\Cesar.Office.Interop\Cesar.Office.Interop\FunctionWord.cs:行号 69
   在 Cesar.Office.Interop.Program.RunMethod(String method, IList`1 param, String app) 位置 G:\笔记本\04-Code\CSharp\01-Office\Cesar.Office.Interop\Cesar.Office.Interop\Program.cs:行号 273
   在 Cesar.Office.Interop.Program.GetOutputFromCommandLineOption(Options opts) 位置 G:\笔记本\04-Code\CSharp\01-Office\Cesar.Office.Interop\Cesar.Office.Interop\Program.cs:行号 123

--------------------------------------------

请在反馈时将上述信息粘贴给我,谢谢!


回复内容
Cesar 2022-07-26 11:45
#1

建议重装下Office试试了

回复主贴