WD6x: Using the FileFind WordBasic Statement

Last reviewed: February 5, 1998
Article ID: Q118904
The information in this article applies to:
  • Microsoft Word for the Macintosh, versions 6.0, 6.0.1

SUMMARY

The FileFind statement creates a list based on search criteria specified by one or more of the statement's arguments. The arguments correspond to options in the Search dialog box.

You can search for certain types of files by using the MacID$() function with the FileFind statement. The MacID$() function returns an application signature or file type in a format that other commands, including the FileFind command, can understand.

The Macintosh does not accept MS-DOS wildcard specifiers such as the asterisk (*) or the question mark (?) when searching for groups of files. Instead, you can use the MacID$() function to convert an application file type to a value that can be used with instructions like FileFind, Files$(), FileOpen, or Kill, all of which require a file type.

MORE INFORMATION

A Macintosh file type is a unique four-letter label assigned to every file format created by a Macintosh application. For example, M6BN file type is used for files created by Microsoft Word 6.0, and TEXT is the file type for text files. This label can be seen if you use the ResEdit program to get information about a file.

In addition, the MacID$() function can return an application signature, which is a four-character sequence that uniquely identifies an application. For example, MSWD is the application signature for Word.

Note that the application signature and file type are case sensitive.

The following sample macro creates a dialog record (an on-screen display of a dialog box) for the FileFind dialog box, sets the search path and file type criteria, specifies that summary information for found files be displayed, and displays the list of found files:

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.

   Sub MAIN
      Dim dlg As FileFind
      dlg .SearchPath = "Macintosh HD:My Documents"
      dlg .Name = MacID$("W6BN")
      dlg .View = 2
      x = Dialog(dlg)
   End Sub

For additional information, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q63304
   TITLE     : WD: File and Creator Types for All Versions


Additional query words: filefind find file wordbasic word basic macro
Keywords : kbmacroexample macword kbfile kbmacro
Version : MACINTOSH:6.0,6.0.1,6.0.1a
Platform : MACINTOSH
Issue type : kbinfo


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: February 5, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.