Chapter 14

Inside COM Add-Ins

In Office 97, the method of developing add-ins varies according to the application. What method you use depends on both the Office 97 application and the programming language it's developed with, such as Microsoft Visual Basic or Microsoft Visual C++. You have a total of nine ways to customize and extend the capabilities of Office 97 through add-ins, with each application, except Microsoft Outlook, having at least two ways to extend its capabilities through add-ins. However, the ways of connecting, disconnecting, registering, and deploying add-ins are quite different in each Office 97 application. Also, because each application has its own add-in model, you can't write code in one file and have it load the same way in any other Office 97 application.

The COM add-in model in Office 2000, however, is what an add-in model should be: one consistent way for developers to connect, disconnect, register, secure, and deploy an add-in for any Office application. In addition, the Office 2000 COM add-in model lets a developer transfer skills and add-ins developed for one Office application to any other. This chapter gives an overview of the COM add-in model. Once you understand the COM add-in model for Office 2000, you'll be able to hone your skills and expand your add-ins to any Office 2000 application and later versions of those applications.

IMPORTANT
Existing add-ins created for Office 97 will continue to work in Office 2000 without modification. The COM add-in model for Office 2000 works side-by-side with the existing add-in model for each Office application. You should note, however, that COM add-ins created for Office 2000 won't work in Office 97. Because the architecture for COM add-ins in Office exists only in Office 2000 and later versions, Office 97 doesn't know how to connect a COM add-in.

In technical terms, a COM add-in is an in-process or out-of-process Automation server. The file extension is .dll or .exe, and you have to implement the interface IDTExtensibility2. You can create it in any programming language (like Visual Basic or Visual C++) that can create an Automation server. In simple terms, a COM add-in is one way for developers to build an add-in and plug it into any Office 2000 application.

NOTE
This chapter assumes that you've read the previous chapter and that you have experience developing add-ins for Office. This chapter is the next step beyond the basic fundamentals of the COM add-in model and is meant to provide more insight into—and give more examples of—the COM add-in model.