WD: Macro to Dock Toolbars That Are Beyond Screen BordersLast reviewed: February 16, 1998Article ID: Q173631 |
The information in this article applies to:
SUMMARYThis article contains a WordBasic macro to dock (move) any active toolbars that are not visible on screen to the top of the active Microsoft Word window.
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/supportnet/refguide/This WordBasic macro lists the names of all toolbars in Word, and then prompts the user to enter the name of the missing toolbar.
Sub MAIN ' Create new document for inserting toolbar names. FileNewDefault ' Loop through all toolbars in Normal template. For i = 1 To CountToolbars(0) ' Insert toolbar names into documents. Insert ToolbarName$(i) + Chr$(13) Next i ' Build variable for prompt. msg$= "Type the missing Toolbar name from the list at " msg$= msg$ + "the left of this Dialog box then click OK." ' If Cancel is selected or incorrect info is entered that ' would cause an error, trap the error and resume to next line. On Error Resume Next ' Display InputBox to get name of toolbar to dock. Lostbar$ = InputBox$(msg$) ' Dock the toolbar. MoveToolbar Lostbar$, 1, 10, 100 ' Close the document created earlier. FileClose 2 End SubTo dock a single toolbar, type the following WordBasic command in a blank macro window and then run the macro
MoveToolBar "<toolbar name>",1,10,100where <toolbar name> is the name of the toolbar displayed in the View Toolbars dialog box.
|
Additional query words:
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |