Microsoft Outlook Programming: Jumpstart for Administrators, Power Users, and Developers

With this chapter, we begin a new section on some of the finishing touches that go beyond simple VBA macros and Outlook forms. You will explore some of the key elements of Outlook's user interface the menus and toolbars and the optional Outlook Bar that displays shortcuts to folders and files.
Highlights of this chapter include discussions of the following:
Why menus and toolbars are actually the same thing
How to make sure that Outlook 2002 is sending messages with the correct account
How to add a new custom toolbar through code and populate it with controls
What code can run any menu or toolbar command programmatically
How to change the toolbars displayed when a user switches folders
How to write code to add and remove groups and shortcuts on the Outlook Bar
Menus and toolbars are actually both examples of CommandBar objects. The Explorer and Inspector objects include child CommandBars collections consisting of all the menus and toolbars. Each CommandBar in the collection contains a CommandBarControls collection holding buttons, combo boxes, and submenus.
| Tip | If you use the Object Browser to locate information on the CommandBar object, don't look in the Outlook library. The CommandBar object is common to all Office programs, so you will find it in the Office library. Where Outlook differs from the other Office programs is that for those programs, the CommandBars collection is a member of the Application |