C# – Word 2003 plug-in installation on Server 2003

add-incms-officems-wordvsto

I've had someone else's pile of stuff handed to me. Among these items is a Word 2003 add-in (VSTO 2005 SE, .NET 2.0) that reportedly had been working fine in 2007, but our deployment environment calls for 2003. It installs apparently fine for Office 2003 — no errors, shows up in add/remove — but the toolbar is unavailable within Word itself.

Supposedly this works fine in someone's test environment, but I've never seen it working in our common dev environment. We have a setup/deploy project with both a MSI and setup.exe. (I tried packing stuff in CABs just in case, I've tried it with prereqs indepdently installed, no apparent difference.)

The MSI, the setup.exe, right-click installing the setup/deploy project in Visual Studio, none of these methods report an error — but none of these methods succeed in showing the toolbar in Word 2003 on Server 2003 either. However, if I point Visual Studio at winword.exe for debugging and start the project, the add-in button shows up. It continues showing up on later, independent client startups. It remains available as a toolbar until I explicitly remove it via add/remove or right-click uninstall or running the MSI and removing.

So now I'm at a loss — what is happening by running in debug that isn't happening during a typical setup/deploy installation?

EDIT: ok, updates. Created a clean VSTO 2005 add-in for Word 2003, new add-in name, clean slate. The same behavior is experienced with a naked project, virgin registry, on both Server 2003 and XP Pro. I'm a local admin on XP, I'm a domain admin on the 2003 box.

Best Answer

Here are some questions for troubleshooting:

  • What kind of add-in are you developing? A Shared Add-in or a VSTO? If VSTO which version?
  • What OS are you using? Vista can be tricky...
  • Check the LoadBehavior of your add-in in the Registry. You find the value either in

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Word\Addins\<add-in class name>\
    

    or

    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Word\Addins\<add-in classname>\
    

If the value of LoadBehavior is 2 your add-in has been disabled during startup. This happens when Word cannot instantiate the add-in, typically because the add-in throws an unhandled exception, or - much more often - because the add-in is not correctly registered.

Have you checked that the VSTO runtime is correctly installed on the target system?

However, even if you use VSTO, for Word the add-in still looks like a classic COM add-in which is extending the classic IDTExtensibility2 interface. Such add-ins must be registered the following way:

  • One of the two registry keys above to tell Word the class name of the add-in plus additional information such as the load behavior and a description
  • The class name of the add-in must be registered under

    HKEY_CLASSES_ROOT\<add-in classname>\CSLID
    
  • The correct version of the COM component must be registered under (where {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} is the guid of the component as specified under HKEY_CLASSES_ROOT\\CSLID):

    HKEY_CLASSES_ROOT\CLSID\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
    

The following two links might also help you further narrowing down your problem:

HOWTO: Troubleshooting Visual Studio and Office add-ins

Troubleshooting Outlook COM Addins – Using ProcMon

Related Topic