I've got the following piece of code:
---
With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.MatchTextExactly = True
.FileName = "data.mdb"
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
AddListItem lstData, .FoundFiles(i)
Next i
End If
End With
---
Which is supposed to search through all of my drives for all of the files called "data.mdb" and then list them in the lstData listbox. It seems that leaving out the .LookIn property just means searching the current drive. That's not so much of a problem, I'm sure I can find my way around it. The problem is that even with the .MatchTextExactly property set to true, I still get files such as "DATA.MDB Design Docs.doc" etc...
How can I get it to only display the "data.mdb" file?
---
With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.MatchTextExactly = True
.FileName = "data.mdb"
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
AddListItem lstData, .FoundFiles(i)
Next i
End If
End With
---
Which is supposed to search through all of my drives for all of the files called "data.mdb" and then list them in the lstData listbox. It seems that leaving out the .LookIn property just means searching the current drive. That's not so much of a problem, I'm sure I can find my way around it. The problem is that even with the .MatchTextExactly property set to true, I still get files such as "DATA.MDB Design Docs.doc" etc...
How can I get it to only display the "data.mdb" file?