Filesearch also returns 'Copy of'' files too

F

FUBARinSFO

Hi:

There are two files in the folder c:\temp:
C:\temp\foobar.doc
C:\temp\Copy of foobar.doc

When I use .Filesearch as below, it returns both files, not the one
'foobar.doc'.

The workaround seems to be to revert back to DIR$() to get the file
names that start with the string, not the files that contain the
string as is the case with Filesearch. Is this still the answer for
Word 2003?

Thanks in advance for your help.

-- Roy Zider


sSrcPath = c:\temp
Set oFS = Application.FileSearch ' FileSearch object
With oFS
.LookIn = sSrcPath
.FileName = "\foo*.doc"
If .Execute >0 Then
< ... do something>
End if
End with
 
Top