Creating COM Add-ins for Multiple Applications
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Each add-in designer in your project creates an add-in that can run in only one application. To create a COM add-in that is available to more than one application, you create a new add-in designer for each application that you want to use the add-in and then customize the add-in designer for each application.
For example, suppose that you want to create an add-in for Microsoft® Word and Microsoft® PowerPoint® that creates an organizational chart from a table in a database and inserts the chart into the document or slide. You would begin by making sure there is an add-in designer for Word and one for PowerPoint.
To create a new Add-in project
- From the File menu in Microsoft® Visual Basic® Editor, click New Project, and then click Add-in Project. The first add-in designer in the Add-in project appears.
- Change the add-in designer's Name property setting in the Properties window. It might be helpful to indicate in the name of the add-in designer which designer goes with which application. For example, the add-in designer for Microsoft® Excel in the Image Gallery project is named dsrImageExcel.
- Enter the appropriate information in the General and Advanced tabs of the add-in designer. Select the application that you want the add-in designer to work with on the General tab. For details, see Configuring an Add-in Designer.
- To add code to the add-in designer, open the View menu, and click Code.
To add another add-in designer to the Add-in project
- Open the Insert menu, and click Components.
- On the Designers tab, select Addin class, and click OK.
- Open the Insert menu, and click Addin Class.
To make a DLL file for the Add-in project
- Save the Add-in project.
- Open the File menu, and click Make projectname.DLL (the default is AddInProject1.DLL).
- In the Make Project dialog box, select the desired DLL name and location.
- Click the Options button to open the Project Properties dialog box if you want to assign a specific version number, add version information, or specify a DLL base address. After you have entered the information, click OK to close the Project Properties dialog box.
- Click OK on the Make Project dialog box to make the DLL file.
See Also
Working with Add-in Designers | Configuring an Add-in Designer | Working with Host Application Object Models