File Search Macro in Word for Windows

Last reviewed: July 30, 1997
Article ID: Q76188
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

In Microsoft Word for Windows, choosing Find from the File menu allows you search in certain directories only after you have completely searched the directories specified in the search option.

MORE INFORMATION

The following macro allows you to enter the search path and search only the specified directories, without going through the entire search list first. You can search more than one directory at a time by typing multiple search paths separated by semicolons.

For example:

   c:\winword\data;c:\winword

If you choose the Cancel button in the Input box, the previous search path is used and the FindFile dialog appears.

Word for Windows Version 2.0

   Sub MAIN
   On Error Resume Next
   SearchList$ = InputBox$("What is the Directory")
   FileFind .SearchPath = SearchList$
   ToolsMacro .Name ="FileFind", .Run
   End Sub

Word for Windows version 1.x

   Sub MAIN
   On Error Goto Bye
   SearchList$ = InputBox$("What is the Directory")
   FileFind .SearchPath = SearchList$
   MacroRun "FileFind"
   Bye:
   End Sub

REFERENCES

"Microsoft Word for Windows Technical Reference," pages 49-50

"Microsoft Word for Windows and OS/2 Technical Reference," pages 171-172

Kbcategory: kbusage kbmacro KBSubcategory:


Additional query words: 1.x 1.0 1.1 1.1a 2.0 winword word6
2.0a 2.0a-CD 2.0b 2.0c winword2 6.0 6.0a 6.0c
Version : 1.x 2.x 6.0
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.