Microsoft Office 2000/Visual Basic Programmer's Guide   

Specifying Load Behavior

When a COM add-in has been properly registered, it's available to whatever applications are specified in the add-in designers that the project contains. The registered COM add-in's display name appears in the COM Add-ins dialog box; if it doesn't, click Add to browse for the add-in and add it to the list.

Selecting the check box next to an add-in in the COM Add-ins dialog box loads (connects) the add-in and makes it available to the user; clearing the check box unloads (disconnects) the add-in, and it can't be run.

As the developer, you specify when a COM add-in should be loaded. You do this in the Initial Load Behavior list in the add-in designer. You can specify that an add-in be loaded in one of the following ways:

The following table describes the different settings for the Initial Load Behavior setting.

Initial Load Behavior setting Behavior
None The COM add-in is not loaded when the application boots. It can be loaded in the COM Add-ins dialog box or by setting the Connect property of the corresponding COMAddIn object.
Startup The add-in is loaded when the application boots. Once the add-in is loaded, it remains loaded until it is explicitly unloaded.
Load on Demand The add-in is not loaded until the user clicks the button or menu item that loads the add-in, or until a procedure sets its Connect property to True. In most cases you won't set the initial load behavior to Load on Demand directly; you'll set it to Load at Next Startup Only, and it will automatically be set to Load on Demand on subsequent boots of the host application.
Load at Next Startup Only After the COM add-in has been registered, it loads as soon as the user runs the host application for the first time, and it creates a button or menu item for itself. The next time the user boots the application, the add-in is loaded on demand — that is, it doesn't load until the user clicks the button or menu item associated with the add-in.