【发布时间】:2017-03-09 00:01:37
【问题描述】:
我们正在为 MS word 开发 VSTO 文档级自定义。我们需要从后台线程访问文档,这样我们就不会停止 UI 刷新。
这适用于 DocumentBase 上的 Sections / Table 等属性。
当尝试访问 CustomDocumentProperties 或 BuiltInDocumentProperties 时收到以下异常
Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Core.DocumentProperties'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{2DF8D04D-5BFA-101B-BDE5-00AA0044DE52}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
是否可以从后台线程访问这些属性?
谢谢
【问题讨论】:
标签: c# multithreading ms-word vsto