Microsoft Office 2000/Visual Basic Programmer's Guide   

Word Add-ins

You can add functionality to a Word solution by creating a Word-specific add-in (also sometimes referred to as a global template). Add-ins are good for adding generic functionality to the Word environment. For example, you might create a Word add-in that contains common tools for working with Word documents. The user can use any of these tools with his or her documents by clicking the toolbars and menu commands that the add-in provides.

To see a list of currently available Word add-ins, click Templates and Add-ins on the Tools menu. The currently loaded add-ins appear checked in the Global templates and add-ins list in the Templates and Add-ins dialog box.

A Word add-in is similar to a Word template in that both add-ins and templates have the .dot file extension. However, add-ins and templates contribute different functionality to a Word document. For more information about templates and how they differ from add-ins, see "Word Templates" later in this chapter.

The ODETools\V9\Samples\OPG\Samples\CH11 subfolder on the Office 2000 Developer CD-ROM contains an add-in called UsefulTools.dot. This template contains four tools that may be helpful to a Word user: Tile Vertical, which tiles multiple windows vertically; Navigate Bookmarks, which lists all bookmarks in the document and allows the user to navigate easily to a bookmark; Global Print, which prints all the .doc files in a specified folder; and Global Replace, which replaces a string of text in all documents in a specified folder. Each of these tools is available through a button on the UsefulTools toolbar that is saved with the add-in. To make these tools available to your own Word documents, load the add-in in the Global templates and add-ins list in the Templates and Add-ins dialog box.