Microsoft Office 2000/Visual Basic Programmer's Guide |
Developers have wanted to use VBA in Outlook since Outlook was first released. Outlook 2000 now supports both the VBA language and the Visual Basic Editor found in all other Office applications.
Outlook supports a single VBA project that is associated with a particular user and a running instance of the application. The other Office applications (except FrontPage) let you associate a VBA project as code behind an individual Office document. Since Outlook has no "document" like the other Office applications, VBA code is associated only with the application.
Note The closest thing to a "document" in Outlook is an Outlook item (for example, a mail message, an appointment item, or a task). As in previous versions of Outlook, you use VBScript to write code behind an Outlook item.
The Outlook VBA project is stored in a file named VbaProject.OTM in the following locations:
You use VBA in Outlook to customize the application by working with the objects, methods, properties, and events available through the Outlook object model. For example, you can add code to application-level events to process messages, add custom command bar controls to call custom VBA procedures, or create Component Object Model (COM) add-ins by using the Visual Basic Editor to debug the add-in as it is being developed and tested. You can access the Visual Basic Editor just like you do in any other Office application, by pointing to Macro on the Tools menu, and then clicking Visual Basic Editor. For information about creating COM add-ins, see Chapter 11, "Add-ins, Templates, Wizards, and Libraries."