J
John Lane
I have the following code:
Dim fs As Object
Dim i As Integer
Set fs = Application.FileSearch
With fs
.NewSearch
.SearchSubFolders = True
.MatchTextExactly = True
.LookIn = "C:\"
.FileName = "msaccess.exe"
If .Execute() > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
It returns the file/pathname four times, apparantely one for each subfolder level.
How do I get it to return only one? Does it work right in NT or XP? Thanks.
Dim fs As Object
Dim i As Integer
Set fs = Application.FileSearch
With fs
.NewSearch
.SearchSubFolders = True
.MatchTextExactly = True
.LookIn = "C:\"
.FileName = "msaccess.exe"
If .Execute() > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
It returns the file/pathname four times, apparantely one for each subfolder level.
How do I get it to return only one? Does it work right in NT or XP? Thanks.