I am experimenting with this FileSearch object. In this experiment, I should be able to search for a word or phrase in a subdirectory. If it is found, message boxes should appear with the name of each file. If not, the msgBox saying "there were no files found" should appear.

Whenever I try to run the code shown below, even for a tiny directory, it takes a really long time and I always eventually get that no files were found, even if I entered the name of an actual file within the specified directory. Can somebody please help me? Thanks, Cindy

Private Sub Command2_Click()
With Application.FileSearch
.LookIn = "C:\Documents and Settings\cburkhardt"
.TextOrProperty = "hello"
.MatchTextExactly = True
Dim i As Integer
If .Execute() > 0 Then
MsgBox "there were " & .FoundFiles.Count & " file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
MsgBox "there were no files found."
End If
End With
End Sub