ACC97: No Match Results in FileSearch When Adding FileTypeID: Q177091
|
Advanced: Requires expert coding, interoperability, and multiuser skills.
When you search for file extensions by using the FileType property of the
FileSearch object, certain file extensions may return a "files found = 0"
message even though the information does exist.
For example, this behavior occurs if you search for information on any of
the following file extensions:
When you search for files that are hidden by default by Windows, they are excluded from indexing and content searching if the FileType property is included.
Do not include the FileType property if the file extension is not normally found in the Files Of Type box in the File Open dialog box.
This behavior is by design.
Option Explicit
Sub TestSearch()
Dim objFS As Object
Set objFS = Application.FileSearch
With objFS
' Resets all the search criteria settings to their default
' settings.
.NewSearch
' Where to search in Windows 95. For Windows NT 4.0, change
' the path to "C:\Winnt\System32\".
.LookIn = "C:\"
' This will limit the search.
.FileType = msoFileTypeAllFiles
.FileName = "*.SYS"
' Search for "WinDir" within a file. This string is present
' in the file, MSDOS.SYS, in Windows 95. For Windows NT 4.0,
' change to "Invalid."
.TextOrProperty = "WinDir"
' Limit the search to the root.
.SearchSubFolders = False
' Begin the search.
.Execute
End With
' Show the number of files found.
MsgBox "Files found = " & objFS.FoundFiles.Count
End Sub
TestSearch
Files found = 0
.FileType = msoFileTypeAllFiles
For more information about "FileSearch," search the Help Index for "FileSearch object," or ask the Microsoft Access 97 Office Assistant.
Keywords : GnlFnd
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: April 27, 1999