Skip to content

Instantly share code, notes, and snippets.

@Surrogate-TM
Last active June 9, 2022 14:38
Show Gist options
  • Save Surrogate-TM/57acbf8326785927ce004a989057a709 to your computer and use it in GitHub Desktop.
Save Surrogate-TM/57acbf8326785927ce004a989057a709 to your computer and use it in GitHub Desktop.
Output of the names of CommandBars and Controls

Enumerating Visio CommandBars

This macro lists all the CommandBars and Controls in Visio

Sub VisioCommandBars()
Dim ap As Application
Set ap = Application
Dim cmbr1 As CommandBar
Dim cnt1 As CommandBarControl
For i = 1 To Application.CommandBars.Count
Set cmbr1 = Application.CommandBars(i)
Debug.Print i, cmbr1.Name & " (" & cmbr1.Controls.Count & ")"
For j = 1 To cmbr1.Controls.Count
Debug.Print vbTab, i & "." & j, cmbr1.Controls(j).Caption & vbCrLf
Next
Debug.Print "-----------------------"
Next
End Sub
Output

1 Version History (1)
1.1 Tas&k Pane
2 Research (1)
2.1 Tas&k Pane
3 Format Object (1)
3.1 Tas&k Pane
4 Selection (0)
5 Help (1)
5.1 Tas&k Pane
6 Share (1)
6.1 Tas&k Pane
7 Task Pane (1)
7.1 Tas&k Pane
8 (0)
9 Property Editor (0)
10 Office Clipboard (1)
10.1 Office Clipboard
11 XML Source (1)
11.1 Tas&k Pane
12 XML Document (1)
12.1 Tas&k Pane
13 Signatures (1)
13.1 Tas&k Pane
14 Document Actions (1)
14.1 Tas&k Pane
15 Clip Art (1)
15.1 Tas&k Pane
16 Document Management (1)
16.1 Tas&k Pane
17 Document Updates (1)
17.1 Tas&k Pane
18 Mail Merge Panes (1)
18.1 Tas&k Pane
19 Fax Service (1)
19.1 Tas&k Pane
20 Meeting Workspace (1)
20.1 Tas&k Pane
21 Attachment Options (1)
21.1 Tas&k Pane
22 Editor (1)
22.1 Tas&k Pane
23 Dictionaries (1)
23.1 Tas&k Pane
24 Thesaurus (1)
24.1 Tas&k Pane
25 History (1)
25.1 Tas&k Pane
26 Smart Lookup (1)
26.1 Tas&k Pane
27 Researcher (1)
27.1 Tas&k Pane
28 Insert From File (1)
28.1 Tas&k Pane
29 Online Content (1)
29.1 Tas&k Pane
30 Alt Text (0)
31 Feedback (1)
31.1 Tas&k Pane
32 Data Selector (1)
32.1 Tas&k Pane
33 Comments (1)
33.1 Tas&k Pane
34 Menu Bar (10)
34.1 &File
34.2 &Edit
34.3 &View
34.4 &Insert
34.5 F&ormat
34.6 &Tools
34.7 &Data
34.8 &Shape
34.9 &Window
34.10 &Help
35 Stencil Menu Bar (7)
35.1 &File
35.2 &Edit
35.3 &View
35.4 &Tools
35.5 &Master
35.6 &Window
35.7 &Help
36 ShapeSheet Menu Bar (10)
36.1 &File
36.2 &Edit
36.3 &View
36.4 &Insert
36.5 F&ormat
36.6 &Tools
36.7 &Data
36.8 &Shape
36.9 &Window
36.10 &Help
37 Icon Editor Menu Bar (5)
37.1 &File
37.2 &Edit
37.3 &Tools
37.4 &Window
37.5 &Help
38 Print Preview Menu Bar (6)
38.1 &File
38.2 &Edit
38.3 &View
38.4 &Tools
38.5 &Window
38.6 &Help
39 Standard (22)
39.1 New
39.2 Open
39.3 Save
39.4 E-mail
39.5 Print Page
39.6 Spelling
39.7 Researc&h...
39.8 Cut
39.9 Copy
39.10 Paste
39.11 Delete
39.12 Format Painter
39.13 Undo
39.14 Redo
39.15 Shapes
39.16 Pointer Tool
39.17 Connector Tool
39.18 Text Tool
39.19 Drawing Tools
39.20 AutoConnect
39.21 Zoom
39.22 Microsoft Visio Help
40 Formatting (20)
40.1 Font
40.2 Font Size
40.3 Bold
40.4 Italic
40.5 Underline
40.6 Align Left
40.7 Align Center
40.8 Align Right
40.9 Change Text Direction
40.10 Left-to-Right
40.11 Right-to-Left
40.12 Bullets
40.13 Decrease Indent
40.14 Increase Indent
40.15 Text Color
40.16 Line Color
40.17 Fill Color
40.18 Line Weight
40.19 Line Pattern
40.20 Line Ends
41 Format Text (11)
41.1 Increase Font Size
41.2 Decrease Font Size
41.3 Strikethrough
41.4 Small Caps
41.5 Superscript
41.6 Subscript
41.7 Align Bottom
41.8 Align Middle
41.9 Align Top
41.10 Decrease Paragraph Spacing
41.11 Increase Paragraph Spacing
42 Format Shape (5)
42.1 Layer
42.2 Corner Rounding
42.3 Transparency
42.4 Fill Pattern
42.5 Shadow Color
43 Action (14)
43.1 Align Shapes...
43.2 Distribute Shapes...
43.3 Connect Shapes
43.4 Lay Out Shapes...
43.5 Flip Horizontal
43.6 Flip Vertical
43.7 Rotate Right
43.8 Rotate Left
43.9 Rotate Text 90°
43.10 Bring to Front
43.11 Send to Back
43.12 Group
43.13 Ungroup
43.14 Shape Data...
44 Snap & Glue (13)
44.1 Toggle Snap
44.2 Toggle Glue
44.3 Snap to Dynamic Grid
44.4 Snap to Drawing Aids
44.5 Snap to Ruler Subdivisions
44.6 Snap to Grid
44.7 Snap to Alignment Box
44.8 Snap to Shape Intersections
44.9 Glue to Shape Geometry
44.10 Glue to Guides
44.11 Glue to Shape Handles
44.12 Glue to Shape Vertices
44.13 Glue to Connection Points
45 View (13)
45.1 Rulers
45.2 Grid
45.3 Guides
45.4 Connection Points
45.5 Page Breaks
45.6 Shapes Window
45.7 Pan && Zoom Window
45.8 Shape Data Window
45.9 Size && Position Window
45.10 External Data Window
45.11 Drawing Explorer Window
45.12 Master Explorer Window
45.13 Layer Properties
46 Web (3)
46.1 Insert Hyperlink
46.2 Back
46.3 Forward
47 Developer (7)
47.1 Run Macro
47.2 &Record New Macro...
47.3 Stop &Recording
47.4 Visual Basic Editor
47.5 Insert Control
47.6 Show ShapeSheet
47.7 Design Mode
48 Layout & Routing (10)
48.1 Routing Style
48.2 Straight Lines
48.3 Curved Lines
48.4 Reset Connector
48.5 Reroute Freely
48.6 Reroute on Crossover
48.7 Never Reroute
48.8 Line Jump Style
48.9 Add Line Jumps To
48.10 Move Other Shapes Away on Drop
49 Stencil (7)
49.1 New Stencil
49.2 Show Document Stencil
49.3 Icons and Names
49.4 Names Under Icons
49.5 Icons Only
49.6 Names Only
49.7 Icons and Details
50 Stencil Standard (14)
50.1 New
50.2 Open
50.3 Save
50.4 E-mail
50.5 Cut
50.6 Copy
50.7 Paste
50.8 Undo
50.9 Redo
50.10 Shapes
50.11 New Window
50.12 Tile Windows
50.13 Cascade Windows
50.14 Microsoft Visio Help
51 Stencil Format (6)
51.1 New Stencil
51.2 Icons and Names
51.3 Names Under Icons
51.4 Icons Only
51.5 Names Only
51.6 Icons and Details
52 ShapeSheet Standard (14)
52.1 New
52.2 Open
52.3 Save
52.4 E-mail
52.5 Cut
52.6 Copy
52.7 Paste
52.8 Undo
52.9 Redo
52.10 Shapes
52.11 New Window
52.12 Tile Windows
52.13 Cascade Windows
52.14 Microsoft Visio Help
53 Formula Bar (4)
53.1 Cancel Change
53.2 Accept
53.3 Set Formula or Name
53.4 Edit Formula
54 Icon Standard (14)
54.1 New
54.2 Open
54.3 Save
54.4 E-mail
54.5 Cut
54.6 Copy
54.7 Paste
54.8 Undo
54.9 Redo
54.10 Shapes
54.11 New Window
54.12 Tile Windows
54.13 Cascade Windows
54.14 Microsoft Visio Help
55 Icon Tools (8)
55.1 Left Button Color:
55.2 Left Button Color
55.3 Right Button Color:
55.4 Right Button Color
55.5 Pencil Tool
55.6 Bucket Tool
55.7 Lasso Tool
55.8 Selection Net Tool
56 Print Preview (18)
56.1 New
56.2 Open
56.3 Save
56.4 Print Page
56.5 &Print...
56.6 Set&up...
56.7 Current Printer
56.8 First Tile
56.9 Previous Tile
56.10 Next Tile
56.11 Last Tile
56.12 Singl&e Tile
56.13 Whole Page
56.14 Current View
56.15 Zoom Out
56.16 Zoom In
56.17 &Close
56.18 Microsoft Visio Help
57 No Document (4)
57.1 New
57.2 Open
57.3 Open Stencil
57.4 Microsoft Visio Help
58 Drawing (6)
58.1 Rectangle Tool
58.2 Ellipse Tool
58.3 Line Tool
58.4 Arc Tool
58.5 Freeform Tool
58.6 Pencil Tool
59 Reviewing (9)
59.1 Show/Hide M&arkup
59.2 &Reviewers
59.3 Ink T&ool
59.4 &Previous Markup
59.5 &Next Markup
59.6 &Delete Markup
59.7 Trac&k Markup
59.8 Re&viewing Pane
59.9 Show &Comments
60 Ink (6)
60.1 Ink Pen 1
60.2 Ink Pen 2
60.3 Eras&er
60.4 C&lose Ink Shape
60.5 Ink &Color
60.6 Ink &Thickness
61 Stop Recording (3)
61.1 Stop Recording
61.2 Pause Recording
61.3 Resume Recording
62 ShapeSheet Formula Tracing (5)
62.1 ShapeSheet Formula Tracing Window
62.2 Trace Dependents
62.3 Trace Precedents
62.4 Back
62.5 Forward
63 Data (4)
63.1 Shape Data
63.2 Link Data to Shapes
63.3 Link Data
63.4 Refresh All
64 Data Graphic (0)
65 Refresh Conflicts (0)
66 Reviewing (0)
67 Commenting (0)
68 Data Options (0)
69 Viewport Preview Pane (0)
70 Export To Word Pane (0)
71 Flow Dynamic Connectors Pane (0)
72 Line Jump Style (10)
72.1 Page Default
72.2 Arc
72.3 Gap
72.4 Square
72.5 2 Sides
72.6 3 Sides
72.7 4 Sides
72.8 5 Sides
72.9 6 Sides
72.10 7 Sides
73 Line Jump Code (6)
73.1 No Lines
73.2 Horizontal Lines
73.3 Vertical Lines
73.4 Last Routed Line
73.5 Last Displayed Line
73.6 First Displayed Line
74 Text Tool Palette (2)
74.1 Text Tool
74.2 Text Block Tool
75 Connector Tool Palette (2)
75.1 Connector Tool
75.2 Connection Point Tool
76 Drawing Page Selected (6)
76.1 Cu&t
76.2 &Copy
76.3 &Paste
76.4 Paste Speci&al...
76.5 (Hyperlink List)
76.6 &Add Comment
77 Drawing Object Selected (19)
77.1 Cu&t
77.2 &Copy
77.3 &Paste
77.4 A&uto Connect
77.5 &Insert Shape Before
77.6 I&nsert Shape After
77.7 &Group
77.8 Contain&er
77.9 (Hyperlink List)
77.10 &Add Comment
77.11 Edi&t Text
77.12 &Data
77.13 Format &Shape
77.14 R&ight-Angle Connector
77.15 Strai&ght Connector
77.16 Cur&ved Connector
77.17 Reset Co&nnector
77.18 Convert &Ink to Text
77.19 Convert Ink to Geo&metry
78 OLE Object Selected (10)
78.1 (Hyperlink List)
78.2 Cu&t
78.3 &Copy
78.4 &Paste
78.5 Paste Speci&al...
78.6 (placeholder)
78.7 &Data
78.8 Fo&rmat
78.9 Format &Shape
78.10 &Object...
79 ShapeSheet (10)
79.1 &Values
79.2 &Formulas
79.3 View Sectio&ns...
79.4 Insert &Section...
79.5 D&elete or Inherit Section
79.6 Insert &Row
79.7 Insert Row &After
79.8 &Delete Row
79.9 E&xpand Row
79.10 &Change Row Type
80 Full Screen (4)
80.1 &Previous Page
80.2 &Next Page
80.3 &Go To
80.4 &Close
81 Text Edit (13)
81.1 Cu&t
81.2 &Copy
81.3 &Paste
81.4 Fo&nt...
81.5 Para&graph...
81.6 Bullet&s
81.7 Insert &Field...
81.8 Recon&vert
81.9 &Change Text Direction
81.10 H&orizontal in Vertical...
81.11 Text &Ruler
81.12 Loo&k Up...
81.13 Tr&anslate...
82 Edit Master (12)
82.1 Cu&t
82.2 &Copy
82.3 &Paste
82.4 Paste Sh&ortcut
82.5 Add to &My Shapes
82.6 Add to &Quick Shapes
82.7 Remove from &Quick Shapes
82.8 &New Master...
82.9 De&lete Master
82.10 &Rename Master
82.11 &Edit Master
82.12 &Help
83 Edit Stencil (12)
83.1 &Edit Stencil
83.2 &Save
83.3 Save &As...
83.4 Propert&ies...
83.5 &View
83.6 &Order
83.7 &Reset Stencil
83.8 &Drawing Explorer Window
83.9 Co&llapse All Groups
83.10 E&xpand All Groups
83.11 &Float Window
83.12 &Close
84 Hyperlink (5)
84.1 &Open
84.2 Open in &New Window
84.3 &Copy Hyperlink
84.4 &Add to Favorites
84.5 &Edit Hyperlink
85 Connection Point (3)
85.1 &Inward
85.2 &Outward
85.3 In&ward && Outward
86 Anchor Bar Base (3)
86.1 &Float Window
86.2 Auto&Hide
86.3 &Close
87 Anchor Bar Shape Data (7)
87.1 &Float Window
87.2 Auto&Hide
87.3 Auto&Fit
87.4 &Link Data to Shapes...
87.5 &Define Shape Data...
87.6 Shape Data Se&ts...
87.7 &Close
88 Anchor Bar Size & Position (4)
88.1 &Float Window
88.2 Auto&Hide
88.3 Auto&Fit
88.4 &Close
89 Anchor Bar Shapes Window (10)
89.1 &Float Window
89.2 &AutoHide
89.3 Icons and Na&mes
89.4 Names &Under Icons
89.5 Icons &Only
89.6 &Names Only
89.7 Icons and De&tails
89.8 &Search Options...
89.9 Clos&e All Stencils
89.10 &Hide Window
90 Toolbars (0)
91 Toolbar In Place (0)
92 Toolbar Hosting In Place (0)
93 Page Tab (6)
93.1 &Insert
93.2 &Delete
93.3 &Rename
93.4 D&uplicate
93.5 Page &Setup...
93.6 Reorder &Pages...
94 Debug (0)
95 Debug Output (0)
96 Drawing Explorer Document (3)
96.1 Propert&ies...
96.2 &Protect Document...
96.3 &Show ShapeSheet
97 Drawing Explorer Pages (2)
97.1 &Insert Page...
97.2 &Reorder Pages...
98 Drawing Explorer Page (4)
98.1 Page Set&up...
98.2 &Ruler && Grid...
98.3 &Delete Page
98.4 &Show ShapeSheet
99 Drawing Explorer Styles (1)
99.1 &Define Styles...
100 Drawing Explorer Shapes (0)
101 Drawing Explorer Shape (4)
101.1 &Shape Data...
101.2 &Layer...
101.3 &Delete Shape
101.4 &Show ShapeSheet
102 Drawing Explorer Layers (1)
102.1 &Layer Properties...
103 Drawing Explorer Layer (3)
103.1 &Visible
103.2 &Active
103.3 &Delete Layer
104 Drawing Explorer Masters (2)
104.1 &New Master...
104.2 Show &Document Stencil
105 Drawing Explorer Master (10)
105.1 Cu&t
105.2 &Copy
105.3 &Paste
105.4 Paste Sh&ortcut
105.5 De&lete
105.6 &Duplicate
105.7 Create &Shortcut
105.8 &Master Properties...
105.9 &Edit Master Shape
105.10 Edit &Icon Image
106 Drawing Explorer Patterns (1)
106.1 &New Pattern...
107 Drawing Explorer Style (3)
107.1 D&efine Styles...
107.2 &Delete Style
107.3 &Show ShapeSheet
108 Master Explorer Document (2)
108.1 Propert&ies
108.2 &Show ShapeSheet
109 Master Explorer Masters (3)
109.1 Page Set&up...
109.2 &Ruler && Grid...
109.3 &Show ShapeSheet
110 Data Explorer Tab (5)
110.1 &Add...
110.2 &Rename
110.3 R&emove
110.4 &Properties...
110.5 &Help
111 Data Explorer List (12)
111.1 Select &All
111.2 Data &Graphic Fields
111.3 Link to &Selected Shapes
111.4 &Unlink
111.5 &Linked Shapes
111.6 Lin&k Data...
111.7 Re&fresh Data...
111.8 &Configure Refresh...
111.9 C&olumn Settings...
111.10 A&rrange by
111.11 &Data Source
111.12 &Help
112 Page Tab Navigation (2)
112.1 (List of Pages In Document)
112.2 &Go to Page...
113 Issues List (6)
113.1 Ig&nore This Issue
113.2 Ignore R&ule
113.3 &Stop Ignoring This Issue
113.4 S&top Ignoring Rule
113.5 S&how Ignored Issues
113.6 A&rrange by
114 Add Command (20)
114.1 File
114.2 Edit
114.3 View
114.4 Insert
114.5 Format Text
114.6 Format Shape
114.7 Tools
114.8 Data
114.9 Shape Operations
114.10 Drawing Tools
114.11 Layout & Routing
114.12 Window and Help
114.13 Web
114.14 Stencil
114.15 ShapeSheet
114.16 Icon Editor
114.17 Ink Tools
114.18 Reviewing
114.19 Built-in Menus
114.20 New Menu
115 &AutoHide (32)
115.1 Drawing Object Selected
115.2 OLE Object Selected
115.3 Page Tab
115.4 Debug
115.5 Debug Spew
115.6 Full Screen
115.7 Toolbars
115.8 ShapeSheet
115.9 Text Edit
115.10 Master
115.11 Stencil
115.12 Hyperlink
115.13 Connection Point
115.14 Toolbar In Place
115.15 Toolbar Hosting In Place
115.16 Drawing Explorer Document
115.17 Drawing Explorer Pages
115.18 Drawing Explorer Page
115.19 Drawing Explorer Shapes
115.20 Drawing Explorer Shape
115.21 Drawing Explorer Styles
115.22 Drawing Explorer Style
115.23 Drawing Explorer Layers
115.24 Drawing Explorer Layer
115.25 Drawing Explorer Masters
115.26 Drawing Explorer Master
115.27 Drawing Explorer Patterns
115.28 Anchor Bar Base
115.29 Anchor Bar Shape Data
115.30 Anchor Bar Size & Position
115.31 Data Explorer Tab
115.32 Data Explorer List
116 &Float Window (30)
116.1 &Tools
116.2 &New
116.3 S&hapes
116.4 Sen&d To
116.5 &Edit
116.6 &Edit
116.7 &File
116.8 Dra&wing Page
116.9 &Go To
116.10 &View
116.11 &View
116.12 &Toolbars
116.13 &Zoom
116.14 &Insert
116.15 &Insert
116.16 F&ormat
116.17 F&ormat
116.18 &File
116.19 &Macro
116.20 A&dd-Ons
116.21 &Shape
116.22 &Shape
116.23 &Master
116.24 &Grouping
116.25 Operatio&ns
116.26 &Order
116.27 &Rotate or Flip
116.28 &Window
116.29 &Window
116.30 &Help
117 UNUSED (0)
118 UNUSED (0)
119 UNUSED (0)
120 UNUSED (0)
121 Picture (6)
121.1 Insert Picture
121.2 Crop Tool
121.3 Rotate Left
121.4 Line Weight
121.5 Format Picture
121.6 Transparency
122 Clipboard (0)
123 Envelope (1)
123.1 &Envelope
124 System (6)
124.1 &Restore
124.2 &Move
124.3 &Size
124.4 Mi&nimize
124.5 Ma&ximize
124.6 &Close
125 (1)
125.1
126 Accessibility Checker (1)
126.1 Tas&k Pane
127 (4)
127.1 Float &Window
127.2 &AutoHide
127.3 Auto&Fit
127.4 &Close
128 Status Bar (1)
128.1 Status Bar
129 Ribbon (1)
129.1 Ribbon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment