Welcome toWord.Tips.Net
Ask a Word Question
Make a Comment
Learn Access Now
Free Printable Forms
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips
Setting Fraction Bar Overhang Spacing in the Equation Editor
Printing On Both Sides of the Paper
Turning Off AutoComplete for Dates
Understanding Auto Line Spacing
Adding Comments to Your Document
Conditional Calculations in Word
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."
WordBasic allows you to select button faces from a group of built-in images, and you can change them on the fly. Even though the available images are quite diverse, selecting the images you want will necessarily involve some compromises on you part. You can see the complete list of available button faces by searching for the "toolbar button images and numbers" in the Help system (use Find, not the Index). The following WordBasic macro can be assigned to a button on the "switcher" toolbar:
Sub MAIN
REM First check if the toolbar is shown or hidden
If ToolbarState("sampler") Then
REM Hide the toolbar and change the button image to "show"
ViewToolbars .Toolbar = "sampler", .Context = 0, .Hide
ChooseButtonImage .Face = 37, .Button = 1, .Context = 0, .Toolbar = "switcher"
Else
REM Show the button and change the button image to "hide"
ViewToolbars .Toolbar = "sampler", .Context = 0, .Show
ChooseButtonImage .Face = 39, .Button = 1, .Context = 0, .Toolbar = "switcher"
End If
End Sub
When you click on the button on the "switcher" toolbar, the "sampler" toolbar is either displayed or hidden, depending on the state of the toolbar when you click on the button. In addition, the image used on the "switcher" toolbar button is changed from an up arrow to a down arrow. You can use different images from the built-in library by changing the values you assign to the .Face variable.
Tip #1121 applies to Microsoft Word versions: 6 95
Create and Merge! Using Word's mail merge tool you can quickly and easily combine data from a variety of data sources to create great individualized documents that incorporate your data in ways that you control. WordTips: Mail Merge Magic is an invaluable source for learning how to harness the full power of Word's mail merging capabilities.