Search code examples
ms-wordvisual-studio-2017vstoword-addins

How to re-add a deleted VSTO Add-In


I've got a strange issue with a Word VSTO add-in on one machine where running the visual studio project opens word but does not attempt to start the add in as far as I can tell.

I got to this point because I accidentally clicked Remove for the Add-in on the Manage COM Add-ins page, instead of re-enabling it after a failure.

I want to know how to re-enable a deleted add-in - I'm thinking that perhaps there is a registry key somewhere I need to get rid of.

  • When I run the project from Visual Studio it does not attempt to start up at all, Word starts instantly with no "something-is-failing" type pause.
  • No breakpoints in ThisAddIn_Startup are hit.
  • In Word : File/Options/Add-ins - the add-in does not appear under Inactive or Disabled Addins
  • Word : Manage COM Add-ins Go... it does not appear.
  • Word : Manage Disabled Items Go... is empty.

I've tried installing and uninstalling the published version, to see if that wakes anything up, and I've tried changing the path of the VS project, just in case that makes a difference (and various restarts, cleans, rebuilds, locally deleting and re-cloning from git etc) but I can't find a way to get this to work again. On a different machine, cloning the add-in from Git and opening it in Visual Studio and its all fine.

I've tried re-adding via the select DLL (or select .) dialog on the COM Add-ins but nothing I select appears to be a valid add-in.

Any help to figure out how to get back to a working development environment would be appreciated.

EDIT There's a lot going on below - so I thought I'd clarify that the successful solution was the online-repair of Office


Solution

  • What is the LoadBehaviour in the registry? It should be 3...

    To find out, look in

    • 32bit Word => Root\Software\Microsoft\Office\Word\Addins\add-in ID
    • 64bit Word => Root\Software\Wow6432Node\Microsoft\Office\Word\Addins\add-in ID

    where Root is HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE, depending on whether the addin is installed for current user or everyone.

    If the value for LoadBehaviour is not 3, then change it to 3 and restart Word.

    Here is the Microsoft docs about it: Registry entries for VSTO Add-ins

    If it still does not work, try to re-enable as it might be hard disabled:

    • In the Manage box, change COM Add-ins to Disabled Add-ins, and click Go.
    • Select the add-in and click Enable. Click Close. Now the add-in can be loaded again...
    • Back in the Manage box, change Disabled Add-ins to COM Add-ins, and then click Go.
    • Check the checkbox next to the disabled add-in. Click OK.

    Here is the Microsoft docs about it: How to: Re-enable a VSTO Add-in that has been disabled

    Also, if you haven't done this already, it is worth setting VSTO_SUPPRESSDISPLAYALERTS to 0 as described on this page: How do I enable VSTO error / display alerts?

    If none of the above helps, then it is worth doing a Online repair of Office from Add or Remove Programs.