Wednesday, November 22, 2006

.NET & Office Interop

Everyone knows what a pain it is to configure it correctly. Numerous articles try to lay out the possible solutions, workarounds,

Here's what worked for me (it it ever gets there), on a Win XP Pro, Visual Studio 2003, ASP.NET 1.1 configuration:

  1. Install Office Interop DLLs
  2. Add the PIA DLLs to the VS Solution
  3. Add ASP.NET to the Administrators group?
    or
  4. Create a user with Admininstrator permissions (at least Debugger group or Power User)?
  5. Impersonate the user in Web.Config
  6. Give permissions to the directories to be read and written by the application (in my case read the template directory and write in the directory where the word document is created)
  7. Give permissions in the the registry to the user to the Software Office key (http://support.microsoft.com/kb/236592)
  8. Modify COM permissions, allowing the user to launch and activate components (http://support.microsoft.com/kb/288366/)
  9. Modify Microsoft Word Component in COM+ so the user impersonates it (http://forums.asp.net/1091578/ShowPost.aspx)
  10. Reinstall ASP.NET (aspnet_regiis -i, http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=363330&SiteID=1)
  11. Reboot the machine
  12. Cross your fingers

Considerations:

Errors:

No comments: