Problem: FileSearch .TextOrProperty WIth Phrase Containing Blanks

C

ChristopherL

The following code will return files containing the phrase: Chris Ate
His Big Lunch which I do not want. I want to get files containing only
the phrase "Chris Ate His Lunch"

With Application.FileSearch
.NewSearch
.LookIn = Folder
.SearchSubFolders = False
.TextOrProperty = "Chris Ate His Lunch"
.filename = "*.txt*"
.MatchTextExactly = True

.Execute

For file_no = 1 To .FoundFiles.Count

Debug.Print .FoundFiles(file_no)

Next

End With

Thank you,
Chris
 

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