ID: Q114849
The information in this article applies to:
This article describes three undocumented Word dialog boxes you can open using the Connect, NewToolbar, and WindowList WordBasic statements. All three of these dialogs are available in Word for Windows, however the Connect dialog is not available in Word for the Macintosh. The article contains three sample macros that you can use to open these dialog boxes.
NOTE: The Connect, NewToolbar, and WindowList statements ARE documented; only their associated dialog boxes are undocumented.
WordBasic Statement Dialog Box
------------------- ----------
Connect Connect To Network Drive
NewToolbar New Toolbar
WindowList Activate
Microsoft 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 professionals 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/support/supportnet/refguide/
You can use the Connect statement in a macro to open the Connect To Network Drive dialog box. In this dialog box, you can select a logical drive letter and type the network path and any password. When you choose OK, Word establishes the network connection.
NOTE: If you choose the Help button in the Connect To Network Drive dialog box, a "Help topic does not exist" error message appears.
The following sample NetConnect macro opens the Connect To Network Drive dialog box:
Sub MAIN
Dim dlg As Connect
GetCurValues dlg
If Dialog(dlg) Then Connect dlg
End Sub
The following modified NetConnect macro inserts the network name in the
Connect To Network Drive dialog box for you. You only need to select a
letter from the Drive list and choose OK.
Sub MAIN
Dim dlg As Connect
GetCurValues dlg
dlg.Path = "\\project\info"
If Dialog(dlg) Then Connect dlg
End Sub
You can use the WindowList statement in a macro to open the Activate dialog box. The Activate dialog box contains a list of all the currently open documents. You can select a document and choose OK to activate that document.
NOTE: If you choose the Help button in the Activate dialog box, Word incorrectly displays the "1, 2, 3... Command (Window menu)" online Help topic.
The following sample WindowActivate macro opens the Activate dialog box. In the Activate list, your current document is selected by default. (This is handy if you are in Full Screen view and want to know the name of your current document.)
Sub MAIN
On Error Resume Next
ToolsMacro .Name = "WindowList", .Show = 2, .Run
End Sub
You can use the NewToolbar statement in a macro to open the New Toolbar dialog box, where you can type the name of a new toolbar and select the template in which you want to store it. The advantage of using the NewToolbar statement is that you do not have to first open the View Toolbars dialog box and then choose the New button.
The following sample MakeNewToolbar macro opens the New Toolbar dialog box:
Sub MAIN
Dim dlg As NewToolbar
GetCurValues dlg
If Dialog(dlg) Then NewToolbar dlg
End Sub
NOTE: If you choose the Help button in the New Toolbar dialog box, Word
correctly displays the New Toolbar Dialog Box online Help topic.
"Microsoft Word Developer's Kit," Microsoft Press, 1994, pages 301, 601, 814
Additional query words: word basic
Keywords : kbmacro wordnt kbmacroexample winword ntword macword word6 word7 word95
Version : WINDOWS:6.0,6.0a,6.0c,7.0,7.0a; MACINTOSH:6.0,6.0.1,6.0.1a
Platform : MACINTOSH Win95 WINDOWS winnt
Issue type : kbinfo
Last Reviewed: April 9, 1999