R
robot
Hello,
I would like to search for files containing text that I specify.
I use the following code:
With Application.FileSearch
.NewSearch
.FileType = msoFileTypeWordDocuments
.FileName = "*.doc"
.TextOrProperty = "gobble"
.LookIn = "c:\test"
.SearchSubFolders = False
.MatchTextExactly = False
MsgBox .Execute()
end with
In the LookIn folder, there is a file with only one word "gobble" in it, yet
the above code fails to find it.
So I modified the value of .TextorProperty to "*gobble*", or "*obbl*", or
"*obb*", but to no avail.
But when I tried "*gob*" or "*go*", the file was found.
(I believe these results are easily reproducible.)
What's going on?
How do I modify the above code so that any occurence of a string (as a whole
word or any part of a word) can be returned?
Suggestions are most welcome! (I use WinXP and Office XP)
I would like to search for files containing text that I specify.
I use the following code:
With Application.FileSearch
.NewSearch
.FileType = msoFileTypeWordDocuments
.FileName = "*.doc"
.TextOrProperty = "gobble"
.LookIn = "c:\test"
.SearchSubFolders = False
.MatchTextExactly = False
MsgBox .Execute()
end with
In the LookIn folder, there is a file with only one word "gobble" in it, yet
the above code fails to find it.
So I modified the value of .TextorProperty to "*gobble*", or "*obbl*", or
"*obb*", but to no avail.
But when I tried "*gob*" or "*go*", the file was found.
(I believe these results are easily reproducible.)
What's going on?
How do I modify the above code so that any occurence of a string (as a whole
word or any part of a word) can be returned?
Suggestions are most welcome! (I use WinXP and Office XP)