Error point: Microsoft.Office.Interop.Word.DocumentClass.SaveAs
Solution:
1. Enter Dcomcnfg.exe to start "Component Services" in "Start", "Run".
2. Double-click "My Computer", "Computer", "Component Services", and then "DCOM Configuration";
3. In "DCOM Config", find "Microsoft Word Application", right click on it, then click "Properties", pop Up "Microsoft Excel Application Properties" dialog box;
Click on the "Logo" tab and select "Interactive User";
4. Click on the "Security" tab, click "Customize" on "Launch and activation Rights", then click on the corresponding "edit" button to add a "NETWORK SERVICE" user in the "Security" dialog box (note To select this computer name) and give it "local launch" and "Local activation" Permissions. Add the ASPNET user to the XP system and the 2000 system;
5. Still the "Security" tab, click "Customize" on "Access", then click "Edit" and add a "NETWORK SERVICE" user to the "Security" dialog box, then give "Local access" permission.
6, finally need to add access to user rights, that is, not adminstrator permissions
Note: If the office2010 service is named Microsoft Word 97-2003 Document if it is office2003,2007 called Microsoft Word 97-2003 Documentation
Solution not found in DCOM configuration in Component Services if Win7 64 bit is installed after office2010
Solution:
Run the comexp.msc-32 command
C # dynamically generates word that can be executed locally, but an error solution is published to IIS