N
Noga Stevens
When I try to search a directory for all files, It returns
only the .doc files. The advance search is set to All
Files.
I have tried using the example below but my computer
doesn't recognize "msoFileTypeAllFiles".
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
only the .doc files. The advance search is set to All
Files.
I have tried using the example below but my computer
doesn't recognize "msoFileTypeAllFiles".
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