Improve company productivity with a Business Account.Sign Up
' Paste this code into the NewMacros module of the Normal Template (Alt-F11 to open VBA editor)
' Press F5 to execute directly from here and paste list into new document.
' Then return to the active document to view the list and continue.
Selection.TypeText "Full list of command bars" + vbCr
Selection.TypeText "CommandBar Caption: ... CommandBar name: ..." + vbCr
For Each cbar In CommandBars
Selection.TypeText cbar.NameLocal + "= " + cbar.Name + vbCr
Selection.TypeText vbCr + "Now select the command bar to examine and double-click here: "
ActiveDocument.Fields.add Range:=Selection.Range, Type:=wdFieldEmpty, text:= _
"MACROBUTTON listControls Find control", PreserveFormatting:=False
Dim ctl, cbName As String
On Error Resume Next ' some built in bars refuse to reeal information
cbName = InputBox("Name of command bar to search?")
.TypeText "Searched commandbar '" + cbName + "'" + vbCr
.TypeText "Caption: ... onAction: ..." + vbCr
For Each ctl In CommandBars(cbName).Controls
.TypeText ctl.Caption + "= " + ctl.OnAction + vbCr
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.