Written by Allen Wyatt (last updated June 25, 2018)
This tip applies to Word 97, 2000, 2002, and 2003
There are certain toolbar buttons that when you press them, they change to have a different appearance. For instance, if you press on the Bold tool, the tool takes on a different look, as if it is depressed. This is done by Word by using two different button graphics. The first is the "unselected" appearance, and the other is displayed when the button has been clicked.
You can use a similar trick with your custom toolbar buttons. As an example of how this could work, let's say that you have a toolbar that you use a lot. You have named this toolbar "sampler." You want this toolbar to be displayed when you click a button on a different toolbar. First, you need to create the new toolbar that will contain the single button that toggles the "sampler" toolbar. In this example, the new toolbar will be named "switcher." The following VBA macro can be assigned to a button on the "switcher" toolbar:
Sub SwitchTools()
' First check if the toolbar is shown or hidden
If CommandBars("sampler").Visible Then
' Hide the toolbar and change the button image to "normal"
CommandBars("sampler").Visible = False
CommandBars("switcher").Controls(1).State. = msoButtonUp
Else
' Show the button and change the button image to "selected"
CommandBars("sampler").Visible = True
CommandBars("switcher").Controls(1).State = msoButtonDown
End If
End Sub
This macro toggles the state of the button (using msoButtonUp and msoButtonDown) to make it have the desired appearance.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1122) applies to Microsoft Word 97, 2000, 2002, and 2003.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 365 applications with VBA programming. Written in clear terms and understandable language, the book includes systematic tutorials and contains both intermediate and advanced content for experienced VB developers. Designed to be comprehensive, the book addresses not just one Office application, but the entire Office suite. Check out Mastering VBA for Microsoft Office 365 today!
A great place for your macro to display status information is, well, in the status bar. Displaying the information is ...
Discover MoreWhen working with macros, you may want to create a variable that will remain constant from one instance of the macro to ...
Discover MoreWhen creating macros, it is often necessary to move the insertion point around the document so that text can be processed ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments