How does VSTO add-in loads

NOTE: This post is written in the context of Excel, but it is the same for all Office VSTO.

Application level VSTO load sequence is triggered when the associated Office application starts. The Application looks into the registry under the key:

HKCU\Software\Microsoft\Office\Excel\Addins\[Addin Name]\Manifest

Workbook level VSTO load sequence is triggered by opening a workbook. The application checks the workbook document for Custom Document Attributes with the specific keys _AssemblyLocation and _AssemblyName. (http://msdn.microsoft.com/en-us/library/ds87aeyf.aspx)

You can view these attributes and modify then via the application. In Excel 2010, go to File > Info and see the Properties panel to the right. The heading “Properties” is a drop down with a small dowb arrow, and gives you Advanced Properties > Custom.

For any kind of installation, we need to ensure that these triggers are set; and ethically removed during uninstall.