WD: WordBasic Examples: ViewToolbars |
Q109760
This article contains a sample macro that demonstrates the use of the following WordBasic statements and functions:
ViewToolbarsThis article supplements the information in online Help. To open this Help topic, click Contents on the Help menu and then click the "Programming with Microsoft Word" topic.
ViewBorderToolbar
ViewDrawingToolbar
ViewToolbars [.Toolbar = text] [, .Context = number] [, .ColorButtons = number] [, .LargeButtons = number] [, .ToolTips = number] [, .Reset] [, .Delete] [, .Show] [, .Hide]Example:
Sub MAIN
On Error Goto done
name$ = InputBox$("What is the name of the toolbar you would \
like displayed?")
ViewToolbars .Toolbar = name$, .Show
n = MsgBox("Would you like to hide the " + name$ + " toolbar?", 35)
Select Case n
Case - 1
ViewToolbars .Toolbar = name$, .Hide
Case Else
End Select
done:
End Sub
There are two additional commands that can also be used to display and hide
certain toolbars:
Sub Main
MsgBox "Choose OK to toggle the Border Toolbar on or off."
ViewBorderToolbar
End Sub
Sub Main
MsgBox "Choose OK to toggle the Drawing Toolbar on or off."
ViewDrawingToolbar
End Sub
Both of the previous macros display the toolbar if the toolbar is
hidden and hide the toolbar if it is displayed.
Additional query words:
Keywords : kbmacro kbprg kbdtacode kbmacroexample winword macword word6 word7 word95
Issue type : kbhowto kbinfo
Technology :
|
Last Reviewed: November 4, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |