It is possible to create a macro that copies all the icons from the commands
in a toolbar. The macro below copies the icons from the Standard toolbar one
by one and inserts the icons at the end of the active document together with
the related captions.
Sub CopyToolbarIcons()
Dim ocontrol As CommandBarControl
With ActiveDocument
For Each ocontrol In CommandBars("Standard").Controls
On Error Resume Next
'Copy the icon
ocontrol.CopyFace
With Selection
.EndKey (wdStory)
'Paste icon
.Paste
'Insert caption of control and paragrah
.InsertAfter vbTab & ocontrol.Caption & vbCr
End With
Next ocontrol
End With
End Sub
Note that the macro only copies icons from "first level" commands in the
toolbar. If a toolbar contains menus that contain commands with icons to be
copied, the macro must be extended to iterate through all commands in each of
the menus too - and in case of submenus, you will have to include them too.
In VBA, all of the commands are controls, i.e. a command in a submenu is a
CommandBarControl in a CommandBarControl in a CommandBarControl (toolbar >
menu command > submenu command).
--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word