Microsoft Office 2000/Visual Basic Programmer's Guide   

Getting Started

The template project helps you to begin building a COM add-in in Visual Basic 6.0. It provides the key components and code that you need to get your add-in working.

Note   To begin using the template project, copy the project from the project from the ODETools\V9\Samples\OPG\Samples\CH11\VB_COM_AddIn subfolder on the Office 2000 Developer CD-ROM to the C:\Program Files\Microsoft Visual Studio\VB98\Template\Projects folder of your Visual Basic 6.0 installation. Copying the template project to this location will ensure that the template appears in the Visual Basic 6.0 New Project dialog box.

To begin building a COM add-in in Visual Basic 6.0

  1. Run Visual Basic 6.0.

  2. In the New Project dialog box, click COM Add-in. This creates a new template project containing a form with OK and Cancel buttons, an add-in designer named AddInDesigner1, and a reference to the IDTExtensibility2 library.

  3. Rename the project, form, and add-in designer by changing their Name property settings in the Properties window. Give them meaningful names that are appropriate to the add-in that you're creating.

  4. Save the project, form, and add-in designer files.

The form and the add-in designer both contain code that serves as a basis for your add-in. You can also build a COM add-in by creating a new DLL project in Visual Basic 6.0 and adding the add-in designer yourself. Adding the designer automatically sets a reference to the IDTExtensibility2 library. For more information about adding an add-in designer to a project, see "Creating COM Add-ins for Multiple Applications" later in this chapter.

Notes