Macro to Create a Subdirectory in Word for Windows

Last reviewed: July 30, 1997
Article ID: Q80657
The information in this article applies to:
  • Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c

SUMMARY

You can use the following macro in any version of Microsoft Word for Windows to create a subdirectory on any drive:

 Sub MAIN
 On Error Goto Bye
 Input "Sub directory name " , a$
 MkDir a$
 Bye:
 End Sub

When you run the above macro, the message "Subdirectory name?" appears on the status bar. Type a name for the subdirectory, and press ENTER. The subdirectory is created on the current directory that Word for Windows is pointing to. For example, if you choose Open from the File menu and see that Word for Windows is pointing to the C:\WINWORD directory, creating a directory with this macro creates a subdirectory under WINWORD.

This macro makes it convenient to create new directories for Word for Windows documents without having to leave the program.

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Kbcategory: kbusage kbmacro KBSubcategory:


Additional query words: winword2 6.0 6.0a 6.0c 1.x 2.0 word6
2.0a 2.0a-CD 2.0b 2.0c winword2
Keywords : kbmacro kbusage
Version : 1.x 2.x 6.0 6.0a 6.0c
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.