Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default Icons copy

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


"Jay Freedman" wrote:

On Sat, 18 Aug 2007 21:26:23 +0300, "Opinicus"
wrote:

"Jay Freedman" wrote

Display the Tools Customize dialog. Right-click the icon on the
toolbar and select Copy Button Image. Close the dialog and paste the
image into the document.


I didn't know you could do that. On occasion I've needed to copy a whole
toolbar (for future reference before updating/upgrading Office) and for that
purpose I've used Snagit. Is it possible to capture a whole toolbar from
within Office?


I don't think so -- as far as I know, it's only one button at a time.
Stick with SnagIt for anything more.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.



 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy Microsoft app icons as images into a Word document John Pickard Microsoft Word Help 3 August 22nd 23 04:33 AM
Icons muffet Microsoft Word Help 0 July 16th 07 03:02 AM
copy pictures of icons on the formatting toolbar in document CyndeeMarcoux Microsoft Word Help 10 February 14th 06 02:41 PM
How do I copy and paste icons from internet toolbar into word doc. Kat Microsoft Word Help 1 January 24th 06 08:11 PM
Icons Jorge New Users 1 December 19th 04 03:28 PM


All times are GMT +1. The time now is 05:30 AM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"