2003 File Search usage

J

Jim Shores

When I do an Advanced File Search, with text or property, includes, with a string with a wildcard, my found list is doubled --it includes each file twice. Is this SOP?

Precisely, I want to write a Word or Access procedure that hunts for a document property string with a wildcard. That doesn't seem to work from the task pane yet, so I used 'text or property' instead of 'Author' and at least get a list back, 2X.

Finally, this code pasted from Help gives no files found no matter what search string used:

Sub FileSearchExampleAlso()

Dim i As Integer

With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents"
.SearchSubFolders = True
.TextOrProperty = "e*"
.FileType = msoFileTypeAllFiles
End With

With Application.FileSearch
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

End Sub

Could ya'll steer me closer?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top