问题描述
我尝试从我的aplication使用以下行访问服务器上的Word Office Interop:
Microsoft.Office.Interop。 Word.Application word = new Microsoft.Office.Interop.Word.Application();
但这会导致一个异常throw: / p>
检索CLSID为{000209FF-0000-0000-C000-000000000046}的组件的COM类工厂失败,原因如下:80070005 Access is拒绝。 (来自HRESULT的异常:0x80070005(E_ACCESSDENIED))。
有没有人知道我可以做什么让我的程序访问? p>
您需要为运行IIS的用户授予启动和激活权限。
开始 - >运行 - > dcomcnfg
在组件服务\计算机下右键单击我的电脑
权限在COM Security
下
I am trying to access the Word Office Interop on a server from my aplication using the following line:
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application();
This however causes an exception to be throw:
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
Does anyone know what I can do to allow my program to access this?
You need to grant permission to 'Launch and Activate' for the user running IIS.
Start-->Run-->dcomcnfg
Under Component Services\Computers Right-Click 'My Computer'
Permissions are under COM Security
这篇关于Windows Server上的Office Interop问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!