One of the great things about Windows is the ability that we have to create COM-based add-in's for the entire suit of Office 2000 applications. In this article, Amit shows us how to create an Outlook 2000 COM add-in using a pure Visual C ATL COM object. He starts by writing a basic functional COM add-in, and then adds standard user interface elements such as toolbars and menu items to Outlook. He finishes up by showing us how to respond to their events.
Building An Outlook COM Add-In With VC /ATL (Page 1 of 7 )
Just recently I developed an Outlook 2000 COM add-in as part of a CRM tool that I was creating. While coding the project, I thought that the details of a similar add-in would make a good topic for an article, especially since most of the Office related COM documentation that I found on the Internet was Visual Basic/VBA related and almost none related to VC++/ATL. The code in this article is not optimized and the general approach has been kept simple so that it's easier to follow.
In this article, we will be looking at how to create an Outlook 2000 COM add-in using a pure Visual C++ ATL COM object. We will start out by writing a basic functional COM add-in, and then I will show you how to add standard user interface elements like toolbars and menu items to Outlook and how to respond to their events.
Next, we will add our own property sheet for the add-in into Outlook's Tools -> Options menu. Along the way we'll see the relevant registry keys and also take a look at useful features of the ATL Wizards and learn how to use them effectively.
Although we'll be writing an Outlook 2000 COM add-in, COM add-ins for other Office 2000 applications like Word, Access, etc can be built very similarly. There are only a handful of things that differentiate creating different add-ins for the different Office 2000 family of applications, like registry keys, for instance, however the basic fundamentals remain the same.
In this article I will assume that you're a Visual C++ COM programmer, and have had some experience with ATL based component development and OLE/Automation, although this is not strictly necessary.
To build and test the add-in, you must have Microsoft Office 2000 installed on your system, or at least Outlook 2000. The project code has been built with Visual C++ 6.0 SP3+/ATL3.0, and tested on Windows 2000 with Office 2000 installed.