Solved

Application.FileSearch how to look in more than one folder

Posted on 2006-11-17
2
133 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 125 total points
ID: 17968471

change this

.SearchSubFolders = False

to

.SearchSubFolders = True
0
 

Author Comment

by:dbfromnewjersey
ID: 18030435
Thanks!
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

778 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