On csdn, some netizens have always asked this question, and I have encountered it myself. For some reason, I wrote it for your reference:
Symptoms:
Owordapplic = new word. Application
WhenProgramThe following error occurs when you run this sentence:
Failed to retrieve components whose CLSID is {000209ff-0000-0000-c000-000000000046} in the com class factory because of the following error: 80070005.
Owordapplic = new word. Application
When the program runs this sentence, the following error occurs:
Failed to retrieve components whose CLSID is {000209ff-0000-0000-c000-000000000046} in the com class factory because of the following error: 80070005.
Solution 1:
Control Panel-> Administrative Tools-> component services-> Computer-> my computer-> DCOM configuration-> Microsoft Word documents
After
Click properties to open the Properties dialog box for this application.
2. Click the ID tab and select an interactive user.
3. Click the "Security" tab, select "Custom" in the "Start and activate Permissions" and "Access Permissions" groups, and then
Custom-> edit-> Add ASP. NET account and iuser _ computer name
* These accounts only exist when IIS is installed on the computer.
13. Make sure that each user is allowed to access the service and click OK.
14. Click OK to disable dcomcnfg.
Solution 2:
If the above method cannot solve the problem, it should be a permission problem. Please try the following method:
Use identity simulation in Web. config and add <identity impersonate = "true" username = "your username" Password = "password"/> In the <system. Web> section.
</System. Web>
----------------------------------------------------------------------------
sales of minicomputers, workstations, server Phone: 010-51280889 to 1007, MSN: wanglinan1121@hotmail.com