Command Bars

Office commands bars are of three types: menu bar, toolbar, and pop-up menu. The Office applications use many built-in command bars, and you can create custom command bars as well. In all Office applications, you can create custom toolbars using the Customize dialog box on the Tools menu. Access lets you also create menu bars and pop-up menus from this dialog box, while all other Office applications require that menu bars and pop-up menus be created from VBA code.

Command bars are represented as CommandBar objects in the Application object's CommandBars collection. To create a new command bar, use this collection's Add method:

Application.CommandBars.Add(Name, Position, MenuBar, _
            Temporary)

Name is the optional name of the command ...

Get Office® XP Development with VBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.