Word Automation in ASP.NET



  • Automating Microsoft Office Word 2010 is very easy and very detailed for any windows application or even when running an ASP.NET application inside the Web Server that comes with Visual Studio 2010 looks to be easy. However when we deploy our solution to a windows server 2003 or 2008 nothing works. The tweak is to touch some registry values and configure some DCOMs as explained on this post

    http://forums.asp.net/t/1358207.aspx/1

    • First, use regedit (from the SysWOW64 folder) to search the registryfor the CLSID(s) related to the command "WINWORD.EXE /Automation" , you might find more than one of them.

      (in my case this was: {000209FE-0000-0000-C000-000000000046} and {000209FF-0000-0000-C000-000000000046})

      Under those keys in HKEY_CLASSES_ROOT\CLSID\, add a string value AppID = {same value as the IDs}

      Then under HKEY_CLASSES_ROOT\AppID\ create a new key (folder) for each of these IDs, and inside each of them add a string value: RunAs = Interactive User

      Next go to Dcomcnfg (from the SysWOW64 folder) and search for those IDs. (there might be a third ID related to Winword.exe), in my case this was {00020906-0000-0000-C000-000000000046}.
      Note all those IDs, then right click on each of them, Properties, Security, and edit both the launch & access permissions to add and give Network Service and Interactive full permissions.



  • Comments



Add a Comment