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
-
Run Visual Basic 6.0.
-
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.
-
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.
-
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
-
The add-in designer is not supported in Visual Basic 5.0. To build a COM add-in in Visual Basic 5.0, create a new ActiveX DLL project, and use a basic class module in place of an add-in designer. The user interface component of an add-in designer specifies data that is written to the registry when the add-in DLL is registered. You must add this data to the registry yourself if you're building a COM add-in in Visual Basic 5.0.
-
Although Visual Basic 5.0 and Visual Basic 6.0 both supply a template project named AddIn, these template projects can be used only to create add-ins for Visual Basic, not to create COM add-ins for the Office 2000 applications.