View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ChristopherL ChristopherL is offline
external usenet poster
 
Posts: 18
Default Problem: FileSearch .TextOrProperty WIth Phrase Containing Blanks

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