Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two filesearches - second one not working 1

Status
Not open for further replies.

Phantek

Programmer
Apr 25, 2011
29
US
I am using Office 2003. I am trying to run two filesearches in the same sub. The first run runs no problem and I get the multiple files that I require.

When the second one runs, it always finds 0 files no matter how many files are actually in the directory in which it is searching.

Any suggestions on how to run two separate file searches?

Code for the second file search:

Code:
With fs
        .NewSearch
        .SearchSubFolders = False
        .FileName = "*.pdf"
        .LookIn = "C:\Temp"        
                        
        MsgBox (.FoundFiles.Count)

End With
 
is "fs" the same filesearch object? I think you need separate objects.

_________________
Bob Rashkin
 
Muaha!

Phantek: you simply forgot the
Code:
.Execute

[tongue]

Have fun!
MakeItSo

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
MakeItSo... THANK YOU!

It's always the stupid mistakes... but I will take an easy solution any day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top