Create Toolbars in Code
Because custom toolbars
are easier to distribute than custom menus, there is less reason to create them in code; however, you can if you like. Toolbars are CommandBar objects, just like menus, but they have a Type property set to msoBarTypeNormal. You get a reference to a toolbar from the Application object’s CommandBars collection using the toolbar’s name. The toolbars are:
|
3-D Settings |
Align or Distribute |
Annotation Pens |
|
AutoShapes |
Basic Shapes |
Block Arrows |
|
Borders |
Callouts |
Chart |
|
Chart Type |
Circular Reference |
Clipboard |
|
Compare Side by Side |
Connectors |
Control Toolbox |
|
Diagram |
Draw Border |
Drawing |
|
Drawing and Writing Pens |
Drawing Canvas |
Envelope |
|
Exit Design Mode |
External Data |
Fill Color |
|
Flowchart |
Font Color |
Formatting |
|
Forms |
Formula Auditing |
Full Screen |
|
Ink Annotations |
Ink Drawing and Writing |
Insert Shape |
|
Line Color |
Lines |
List |
|
Nudge |
Online Meeting |
Order |
|
Organization Chart |
Pattern |
Picture |
|
PivotTable |
PivotTable Field List |
Protection |
|
Refresh |
Reviewing |
Rotate or Flip |
|
Shadow Settings |
Standard |
Stars & Banners |
|
Stop Recording |
Task Pane |
Text To Speech |
|
Visual Basic |
Watch Window |
Web |
|
WordArt |
Use the CommandBar object’s Show method to display a toolbar. For example, the following code displays each of the toolbars in turn, pausing between each. This is useful for finding the name of a particular toolbar:
Sub ShowToolbars( ) Dim cb As CommandBar, show As Boolean For Each cb In Application.CommandBars If cb.Type ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access