相关疑难解决方法(0)

访问COM组件时出错

我为Microsoft Office Word构建了一个加载项.当Word以管理员身份运行时使用加载项没有问题,但是当它不以管理员身份运行时,访问功能区元素有两个常见的例外.

第一个例外:

Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Core.IRibbonUI'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000C03A7-0000-0000-C000-000000000046}' failed due to the following error:  could not be found. (Exception from HRESULT: 0x80030002 (STG_E_FILENOTFOUND)).
   at Microsoft.Office.Core.IRibbonUI.InvalidateControl(String ControlID)
Run Code Online (Sandbox Code Playgroud)

通过以下代码使控件无效时,会发生此错误:

ribbon.InvalidateControl("control-id");
Run Code Online (Sandbox Code Playgroud)

第二个例外:

Unable to cast COM object of type 'Microsoft.Office.Interop.Word.ApplicationClass' to interface type 'Microsoft.Office.Interop.Word._Application'. This operation failed because the QueryInterface call on the COM component for the interface …
Run Code Online (Sandbox Code Playgroud)

c# com office-2007 ms-word

29
推荐指数
2
解决办法
5万
查看次数

从Outlook获取未读邮件

有没有办法将特定文件夹中的所有邮件发送到我的应用程序?

.net c# outlook

8
推荐指数
2
解决办法
2万
查看次数

标签 统计

c# ×2

.net ×1

com ×1

ms-word ×1

office-2007 ×1

outlook ×1