Microsoft.Office.Core.IDTExtensibility2

A COM Add-in is an in-process COM server (an ActiveX DLL) that must implement the Microsoft.Office.Core.IDTExensibility2 interface.
All COM add-ins must implement the IDTExtensibility2 interface and it is this interface that is used by all Office applications to communicate with COM add-ins.
All COM Add-ins must implement the following five methods of this interface:


  • OnConnection - This method is called when the COM add-in is loaded into the application.

The add-in might be connected on startup, by the user, or through Automation (changing the Connect property to true)
Application - provides a reference to the Application object which the COM add-in can then use
ConnectMode - specifies how the add-in was loaded (ext_ConnectMode enumeration)
AddinInst - provides a COM add-in object which refers to the instance of the class module which code is currently running. Used to return the programmatic identifier for the add-in.
Custom() - a variant array providing additional information.


  • OnDisconnection - This method is called when the COM add-in is unloaded from the application.

This also occurs when the application in closed.
The add-in should perform any cleanup of resources in this event and restore any changes made to the host.
The add-in might be disconnected when the application exits, by the user or through Automation.
RemoveMode - specifies how the add-in was unloaded (ext_DisconnectionMode enumeration)
Custom() - a variant array providing additional information.


  • OnStartupComplete - This method is called when the application has finished starting up and has loaded the COM add-in that was registered to load at startup.

Whenever a COM add-in is installed or removed from the host application, this event fires.
If the add-in is not loaded at startup then this event does not fire
If the add-in is loaded this event occurs after the OnConnection event.


  • OnBeginShutdown - This method is called when the application is closed and the add-in is still loaded.

If the add-in is not loaded when the application is closed this event does not fire
If the add-in is loaded when the application is closed this event occurs before the OnDisconnection event.


  • OnAddinsUpdate - This method is called when ANY COM add-in is loaded or unloaded in the Office application. The custom parameter is not set by any of the Office applications. You can only use the Application.COMAddins collection to check what has been loaded or unloaded. Called if the add-in was connected during startup. At the point when this method is called, the host application's UI is fully active.



© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

Top

PrevNext