Microsoft KB Archive/118904

-

{| The information in this article applies to:
 * width="100%"|
 * 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
 * }

-

Last reviewed: February 5, 1998

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.