Button Bonanza

Stars, pencils, light bulbs, puppy dogs, faces, diamonds, and hearts. What am I talking about? Toolbar buttons! Lots and lots of toolbar buttons!

If you like assigning macros to toolbar buttons, you’re probably tired of the paltry 42 images you can use on those buttons by default. But fear not! Word has hundreds of images available. You just have to know how to get to them. The only way I know is with a macro, and I’m perfectly happy to share it with you:

HowManyToolBars = 10
HowManyButtons = 150
first = 1
last = HowManyButtons
On Error GoTo -1: On Error GoTo Warning
For toolbar = 10 To HowManyToolBars * 10 Step 10
TbarName$ = "Buttonbar " + _
WordBasic.[LTrim$](Str(toolbar / 10))
WordBasic.NewToolbar Name:=TbarName$, Context:=0
For button = first To last
WordBasic.AddButton TbarName$, 1, 1, "Bold", button, 0, ""
Next button
first = first + HowManyButtons
last = last + HowManyButtons
WordBasic.SizeToolbar TbarName$, 600
WordBasic.MoveToolbar TbarName$, 0, toolbar, (toolbar * 2) + 100
Next toolbar
GoTo Endmacro
WordBasic.MsgBox "Buttonbar " + _
WordBasic.[LTrim$](Str(toolbar / 10)) + " already exists.", "Delete Toolbar"
End Sub

If you don’t know how to use macros like that one, you can learn how here.

After you run it, you’ll have 10 new toolbars, named Buttonbar 1, Buttonbar 2, and so on. Each toolbar will have 150 buttons. For the sake of programming simplicity, each button does the same thing: turn on bold formatting. But you can see a button’s original function by resting your mouse pointer over it and waiting a few seconds for its tooltip to appear. You can also copy the images from any of the buttons to paste on any other buttons you want. For example, if you want to assign macros to custom toolbar buttons, you now have lots of button images to choose from. You can learn more about assigning macros to toolbar buttons here:


If you decide you no longer need the toolbars and their many buttons, you can delete them by running this macro:

HowManyToolBars = 10
On Error GoTo -1: On Error GoTo Warning
For toolbar = 10 To HowManyToolBars * 10 Step 10
WordBasic.ViewToolbars toolbar:="Buttonbar " + _
WordBasic.[LTrim$](Str(toolbar / 10)), Delete:=1
Next toolbar
GoTo Endmacro
WordBasic.MsgBox "The toolbar does not exist.", "No Such Toolbar"
End Sub

If you really want to go crazy, you can step up the “10” in this line to create more than 10 toolbars:

HowManyToolbars = 10

And you can step up the “150” in this line to create more than 150 buttons on each toolbar:

HowManyButtons = 150

If you want to play around with this, please be judicious. The higher you set those numbers, the longer it will take to create the toolbars and buttons, and the more unwieldy they will become. I think 150 is pretty manageable for the number of buttons on a toolbar. You can set this to, say, 500, but that makes a *big* toolbar. And how many toolbars do you really need? The highest I’ve gone is 30, but I think 10 is plenty. It would be interesting to know how many images are actually available. After a while, quite a few of the images will be blank, and many of them will be duplicates.

WARNING: Be sure to adjust the macro that *deletes* buttons to correspond with the macro that *makes* buttons. To be more specific, the line “HowManyToolbars” should be set to the same number in both macros. If you ignore this, you could end up deleting all those toolbars by hand (under View > Toolbars).

Here are the corresponding macros for Word 6 and 95, which have only 366 images altogether, so don’t try to make the macro go any higher. If you do, you’ll just get an error message. The name of the toolbar here is “Buttons.”


Sub MAIN On Error Goto Warning NewToolbar "Buttons" AddButton "Buttons", 1, 1, "Bold", 0 For button = 1 To 366 AddButton "Buttons", button, 1, "Bold", button Next button SizeToolbar "Buttons", 600 Goto Endmacro Warning: MsgBox "The toolbar already exists.", "Delete Toolbar" Endmacro: End Sub 'MACRO ENDS HERE

On Error Goto Warning
ViewToolbars .Toolbar = "Buttons", .Delete
Goto Endmacro
MsgBox "The toolbar does not exist.", "No Such Toolbar"
End Sub

Thanks to Frazer Wright for suggesting this topic.



Responding to last week’s article on setting Word 2002’s tracking format, Keith Soltys wrote:

I was interested to note your macro for setting Word 2002 to mark deleted text as strikethrough. In versions of Word prior to 2002, I’ve usually set deleted text to be hidden. I was surprised to see that Word 2002 didn’t allow you to change the option for this; I guess they really want you to use the balloons, a “feature” that I detest. (They also broke comments; there’s a market for an addon to make Word 2002 comments work the same way that Word 2000 did).

However, I did run into a really interesting bug that you might not be aware of. If you are using Word 2000 and have your revision tracking options set so that revision tracking is on and deleted text is shown as hidden, this setting gets carried forward into your Word 2002 document. You can’t change it through the interface, only through VBA.

In this case, and if you are not using balloons, you may run into pagination issues. What happens is that in print layout view, Word may insert spurious blank pages when it finds deleted text. Pagination will be OK in normal view, but in print layout you will get any number of blank pages added into your file. It gets even more interesting–if you go to print preview, your file may balloon in size to several thousand pages.

The conditions for this to happen are quite specific. You must have revision tracking set so that deleted text is marked as hidden and revision tracking must be set to Final Showing Markup, and you must be in Print Layout view and not using balloons.

The fix is to use VBA to change how Word shows deleted text from hidden to strikethrough. You can also accept the changes in the file. Or set revision tracking to Final, or use balloons.

I encountered this bug not long after “upgrading” to Word 2002. I posted a message about the problem to the word-pc list and was contacted by someone from Microsoft, who eventually confirmed that it was indeed a bug.


Adding to Rohn Solecki’s technique (explained in last week’s newsletter) of using formatting to emulate text on a green-screen computer monitor, Stephen Riley wrote:

I used to do something very similar “back in the day”. Another great advantage is being able to cheat and edit the data you have captured.

It’s sometimes a heck of a lot easier to do this than to setup meaningful data in whatever application you are documenting.

As an extra snippet this was when I was documenting green screen Unix apps. Screen capture was via a terminal emulator (Reflection?) running on a PC.

For report files, print to .txt file and ftp from server to PC. Similar Style definition tweaked for 132 chars and using a landscape page.


Mary Eberle sent in a question that some astute reader may be able to answer:

I have been using AutoCorrect in Word 97 a lot lately. I have two approaches to the item that replaces what I type: (1) unformatted and (2) formatted (i.e., including a word or phrase in italics, bold, or something like that).

I just bought a laptop and copied my Normal.dot file onto the laptop. The “formatted” items in the AutoCorrect list copied, but the “unformatted” items did not. Do you know how to make the “unformatted” ones copy as well?

Mary also provided the following tip:

The reason I’ve been using AutoCorrect so much is that I’ve found a way to simplify my editing considerably. For example, if the author has used the verb “is” but the verb should be “are,” I have an AutoCorrect entry that changes “isz_” (where the _ represents a space–the trigger for AutoCorrect to make the change) to “are”; I place the cursor right after the “is” and then access the AutoCorrect feature with a function key that types “z space backspace” and the “is” toggles to “are.” By using the same function key I can toggle “are” back to “is” (“arez” becomes “is”). I have set up numerous such pairs in my original AutoCorrect file. I used “z” because in English it doesn’t form many words at the end of a word; if one just uses a space, AutoCorrect jumps in to “help” when it is not wanted.

You may wonder how I’m using a function key to accomplish the “z” thing. Well, I was actually using a key on my programmable X-keys keyboard.

One reason the z_space approach and the X-keys are helping me speed up my editing is that I don’t have to take my right hand off the mouse, so I can quickly move to the next thing that needs to be fixed.

Further information: Just typing “z” and then “space” will invoke the “isz to are” or “arez to is” toggle. No backspace or macro is needed. I’ve been using the programmable X-keys for so long now that I’m not used to just using the regular keyboard. Anyway, I hope that this toggle idea is useful to you.


Susan Bullowa asked the following questions. Any takers?

1. On rare occasions that I cannot seem to reproduce on my own, a screen tip appears when my cursor hovers over a paragraph (not the same as pressing SHIFT+ F1). The yellow box summarizes all of the formatting information for that paragraph. I love it but cannot seem to get it to appear consistently. Would anyone know what it is?

2. Your recent newsletters on styles that you and other book editors use have been very helpful. I had evolved to creating a template for the freelance work I do for a publisher. The compositor there uses Quark on a Mac. I’ve tried to make it easy for him to convert my PC Word files (RTF naturally) into Quark. I’d like to make a template for the authors who often do not know how to use styles. Has anyone created a basic template for the poor dears who reformat all of their Normal-style paragraphs manually? A template that also guides them?

Thanks to all for their comments and tips.



Some people enjoy creating and making available even more toolbar buttons. Here’s one commercial source:


And a free one:


This entry was posted in Macros. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

You must be logged in to post a comment.

  • The Fine Print

    Thanks for reading Editorium Update (ISSN 1534-1283), published by:


    Articles © on date of publication by the Editorium. All rights reserved. Editorium Update and Editorium are trademarks of the Editorium.

    You may forward copies of Editorium Update to others (but not charge for it) and print or store it for your personal use. Any other broadcast, publication, retransmission, copying, or storage, without written permission from the Editorium, is strictly prohibited. If you’re interested in reprinting one of our articles, please send an email message to editor@editorium.com

    Editorium Update is provided for informational purposes only and without a warranty of any kind, either express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, and freedom from infringement. The user (you) assumes the entire risk as to the accuracy and use of this document.

    The Editorium is not affiliated with Microsoft Corporation or any other entity.

    We do not sell, rent, or give our subscriber list to anyone.