Intelligible Names for Macros

Written by Allen Wyatt (last updated February 18, 2020)
This tip applies to Word 97, 2000, 2002, and 2003


When you assign macros to a toolbar, you have the option to change the Name assigned to the macro on the toolbar. If you later want to change this name, you can display the Customize dialog box (right-click on the toolbar and choose Customize from the resulting Context menu) and then right-click on the toolbar button.

There is only one problem with this approach: The Name setting for the toolbar button is nothing more than the name that appears as text within the toolbar, if you choose to have text or text and image displayed in the toolbar. (This may sound a bit confusing, especially to a Word novice. It all has to do with the settings that you choose when first adding the macro to your toolbar or when you display the Modify Selection menu for the toolbar button.) What if you want to change the actual ToolTip that appears when you hover the mouse pointer over the toolbar button?

Unfortunately, there is no easy way to change the ToolTip from any menu you can display in Word. Again, the Name field in the Modify Selection menu only controls what is shown as text within the toolbar button; it does not affect the ToolTip. So what are you to do? The only thing you can do is modify the ToolTip text via VBA and modify it in that way. The following short macro will do the trick:

Public Sub FixToolTip()
    Const sToolTip As String = "My ToolTip Text"
    Const sTBName As String = "Standard"
    Const iBtnIdx As Integer = 5

    CommandBars(sTBName).Controls(iBtnIdx).TooltipText = sToolTip
End Sub

This macro only has to be run once, because Word remembers the new ToolTip text once it is set. All you need to do is change the values assigned to the three constants at the beginning of the macro:

  • sToolTip. This is the text you want displayed as a ToolTip.
  • sTBName. This is the name of the toolbar on which the button resides. This is the same toolbar name that you see when you choose Toolbars from the View menu.
  • iBtnIdx. This is the numeric position of the button on the toolbar. If you are using Word 97, all you need to do is count the buttons from the left side of the toolbar, beginning with one. If you are using Word 2000 or later, all buttons may not be displayed on the toolbar. Simply undock the toolbar so they are all displayed in their regular order, and then do your count.

If you ran the macro exactly as it appears above, then the fifth button from the left on the Standard toolbar would have the ToolTip text of "My ToolTip Text".

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1494) applies to Microsoft Word 97, 2000, 2002, and 2003.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Non-breaking Em Dashes

Need an em dash to be "sticky" on both ends of the dash? Word doesn't provide such formatting, but there are a few ...

Discover More

Counting Colors from Conditional Formats

Conditional formatting is a great way to make sure that your information looks a particular way, even if the information ...

Discover More

Editing the Windows Registry

The Registry is the central depository of configuration information used by Windows and by programs running on your ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (menu)

Options in Creating New Files

You'd think that Word would be consistent, right? Wrong! Here's one example where Word is anything but consistent when it ...

Discover More

Occurrences of a Text String within a Document

You may have a need to find out how many times a certain text string occurs within a document. You can find out manually ...

Discover More

Assigning a Macro to a Button in Your Text

One way you can access macros is through the use of a button, added directly into the text of your document. This is done ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is five less than 7?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.