Couldn't find Microsoft Word Document in DCOM

2019-06-16 11:01发布

问题:

I am creating a simple asp.net web site that use office 2007/2010 automation .. when i published the website on the iis 7 on my local machine (window 7) have an exception

 Retrieving the COM class factory for component with CLSID 
 {000209FF-0000-0000-C000-000000000046} failed due to the following error: 
 80080005 Server execution failed (Exception from HRESULT: 0x80080005 
 (CO_E_SERVER_EXEC_FAILURE)).

I have searched for this exception and i found that i have to set some permissions to office in DCOM Config.

I have opened the component services and opened DCOM Config, but i have not found Microsoft Word Document i have found only office word 97 - 2003.

can any one tell me how to solve this problem.

回答1:

Found the answer here: DCOM Failure of Office Automation

If you are running a 64-bit server with 32-bit Office, you may have trouble finding this DCOM setting. You will need to run "MMC -32" from the command prompt to launch 32-bit MMC and then add 'Component Services' from the 'File > Add / Remove Snap-ins' menu.



回答2:

Yes, office word 97 - 2003 is a right name of DCOM document (resp. application) Word 2007 or 2010. Don't ask me why...

Where could be the trouble?

The user must have access to desktop. If Word is called from ASP.NET, it has probably not this access. So set in dcomcnfg.exe an account explicitly. Don't use The launching user (it is a IIS identity, it hasn't its own desktop) and don't use The interactive user (it works only if some user is logged in).

In my solution I have set:

  • I have created new user (in user group), called WordUser
  • I have created in IIS new application pool with WordUser permission; Load User Profile must be true
  • DCOM I have set to use WordUser, on Security tab I've added WordUser wit Launch and activation Permission and Access Permission

Maybe another way is possible, but this should work.