This documentation is archived and is not being maintained.

IManagedAddin Interface

Implement the IManagedAddin interface to create a component that loads managed add-ins. This interface was added in the 2007 Microsoft Office system.

interface IManagedAddin : IUnknown
    HRESULT Load(
        [in] BSTR bstrManifestURL, 
        [in] IDispatch *pdispApplication);
    HRESULT Unload();

The following table lists the methods that are defined by the IManagedAddin interface.




Called when a Microsoft Office application loads a managed add-in.


Called just before a Microsoft Office application unloads a managed add-in.

Microsoft Office applications, starting with the 2007 Microsoft Office system, use the IManagedAddin interface to help load Visual Studio Tools for Office add-ins. You can implement the IManagedAddin interface to create your own add-in loader and runtime for managed add-ins, instead of using the add-in loader (VSTOLoader.dll) and runtime included with Visual Studio Tools for Office. For more information about VSTOLoader.dll and the Visual Studio Tools for Office runtime, see Architecture of Application-Level Add-Ins.

How Managed Add-ins Are Loaded

The following steps occur when an application starts:

  1. The application discovers add-ins by looking for entries under the following registry key:

    HKEY_CURRENT_USER\Software\Microsoft\Office\<application name>\Addins\

    Each entry under this registry key is a unique ID of the add-in. Typically, this is the name of the add-in assembly.

  2. The application looks for a Manifest entry under the entry for each add-in.

    Managed add-ins can store the full path of a manifest in the Manifest entry under HKEY_CURRENT_USER\Software\Microsoft\Office\<application name>\Addins\<add-in ID>. A manifest is a file (typically, an XML file) that provides information that is used to help load the add-in.

  3. If the application finds a Manifest entry, the application tries to load a managed add-in loader component. The application does this by trying to create a COM object that implements the IManagedAddin interface.

    The Visual Studio Tools for Office runtime includes an add-in loader component (VSTOLoader.dll), or you can create your own by implementing the IManagedAddin interface.

  4. The application calls the IManagedAddin::Load method and passes in the value of the Manifest entry.

  5. The IManagedAddin::Load method performs tasks required to load the add-in, such as configuring the application domain and security policy for the add-in that is being loaded.

For more information about the registry keys that Microsoft Office applications use to discover and load managed add-ins, see Registry Entries for Application-Level Add-Ins.

Guidance for Implementing IManagedAddin

If you implement IManagedAddin, you must register the DLL that contains the implementation by using the following CLSID:


Microsoft Office applications use this CLSID to create the COM object that implements IManagedAddin.

Caution noteCaution:

This CLSID is also used by VSTOLoader.dll in the Visual Studio Tools for Office runtime. Therefore, if you use IManagedAddin to create your own add-in loader and runtime component, you cannot deploy your component to computers that are running add-ins created by using Visual Studio Tools for Office.