Solved

Application.FileSearch how to look in more than one folder

Posted on 2006-11-17
2
131 Views
Last Modified: 2008-02-01
Part of my existing code is as follows:

With Application.FileSearch
        .NewSearch
        .FileName = "*.csv"
        .SearchSubFolders = False
        .LookIn = "S:\Folder1\Data
        .Execute

        etc, etc.


Question:    How would I set the above type of code up if I wanted to look in more folders, such as S:\Folder2\Data,
                  S:\Folder3\Data, etc, etc.
                  Do I have to re-code the above for each folder I want to look in?  Or can I list multiple folders on the
                  ".Lookin =" line?

I'm hoping for something like this:

With Application.FileSearch
        .NewSearch
        .FileName = "*.csv"
        .SearchSubFolders = False
        .LookIn = "S:\Folder1\Data, S:\Folder2\Data, S:\Folder3\Data   <----don't know how to code it but want to look
                                                                                                           in multiple folders here.
        .Execute

        etc, etc.




             
 
0
Comment
Question by:dbfromnewjersey
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 125 total points
ID: 17968471

change this

.SearchSubFolders = False

to

.SearchSubFolders = True
0
 

Author Comment

by:dbfromnewjersey
ID: 18030435
Thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now