Tuesday, January 09, 2007

Using Images in CommandBarButtons

A reader asked me whether he could add any image to a Word or Excel toolbar button without using any VBA. I have put together a couple of screenshots from Word, but they are virtually identical in Excel (pre Office 2007). Office 2007 has a Ribbon instead, so that post will come later.

Image 1

If you right click on the Toolbar area in word or Excel, you can customise (forgive the Australian spelling with an 's'!) the way the Toolbar looks. (see Image 1) . Click "Customize" at the bottom of this context menu.

Image 2

This will display the "Customize" menu (Image 2). To add your own button, select the Commands tab, and select "Macros" from the list. If there is nothing in the right window (Normal.NewMacros.Macro1 is in the right window in this example), you need to record a macro using the Macro Recorder.

Image 3


Now, drag this macro from the right window onto the Toolbar where you want it. The I Beam cursor is displayed to indicate where the new button will be displayed. (Image 3)

Image 4


When you let go of the mouse the button is displayed (Image 4)

Image 5

To rename the Button, change the text in the Name section. To show your image, copy an image from somewhere on your computer to the clipboard, and click "Paste Button Image". Click Image and Text to display your image. (Image 5)

Labels:

0 Comments:

Post a Comment

<< Home