Microsoft Office Forums


Reply
Thread Tools Display Modes

Application.FileSearch VBA Loop Through Folders

 
 
SVCitian
Guest
Posts: n/a
 
      06-22-2010, 03:09 PM
Hello,

I want help.. I have seen help files but couldn't make heads or tails
of the ScopeFolder and SearchScopes methods

Totally confused.

What I want to do is:

I want to loop through the Root Directory... in the first 5 folders
only... with fixed names..

C:\bdt1 <--
C:\xbd2 <--
C:\bbb3 <--
C:\ggg4 <--
C:\ttt5 <--
C:\xxx1
C:\xxx2


and then search in C:\first5folders[ ]\2010\05 for Excel Files.

To achieve this... I want to Add just The 5 folders.. .and search for
Excel Files in there...

C:\bdt1\2010\05
C:\xbd2\2010\05
C:\bbb3\2010\05
C:\ggg4\2010\05
C:\ttt5\2010\05

Since there are 10s of thousand of files and folders... in the C:
\Folder[1to5].. I thought this is the fastest option to go through
just the folders that I want in the format YYYY\MM\[every sub folder
under here and look for Excel Files]

I don't know how to achieve this.... I think i need to add these
folders in search scopes or something... which I have no clue.. how to
do it...

Please help.

I have achieved it through using wildcard pattern in path names... but
I prefer to do it more elegantly.


 
Reply With Quote
 
 
 
 
Karl E. Peterson
Guest
Posts: n/a
 
      06-30-2010, 04:42 PM
SVCitian wrote on 6/22/2010 :
> Hello,
>
> I want help.. I have seen help files but couldn't make heads or tails
> of the ScopeFolder and SearchScopes methods
>
> Totally confused.
>
> What I want to do is:
>
> I want to loop through the Root Directory... in the first 5 folders
> only... with fixed names..
>
> C:\bdt1 <--
> C:\xbd2 <--
> C:\bbb3 <--
> C:\ggg4 <--
> C:\ttt5 <--
> C:\xxx1
> C:\xxx2
>
>
> and then search in C:\first5folders[ ]\2010\05 for Excel Files.
>
> To achieve this... I want to Add just The 5 folders.. .and search for
> Excel Files in there...
>
> C:\bdt1\2010\05
> C:\xbd2\2010\05
> C:\bbb3\2010\05
> C:\ggg4\2010\05
> C:\ttt5\2010\05
>
> Since there are 10s of thousand of files and folders... in the C:
> \Folder[1to5].. I thought this is the fastest option to go through
> just the folders that I want in the format YYYY\MM\[every sub folder
> under here and look for Excel Files]
>
> I don't know how to achieve this.... I think i need to add these
> folders in search scopes or something... which I have no clue.. how to
> do it...
>
> Please help.
>
> I have achieved it through using wildcard pattern in path names... but
> I prefer to do it more elegantly.


Well, it's still unclear to me what exactly you're asking. If you have
a list of 5 search paths, the easiest, most elegant way to search each
of them is one at a time. What am I missing?

--
..NET: It's About Trust!
http://vfred.mvps.org


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Macro - Loop through folder and move files to other folders hurlbut777 Excel Programming 9 12-05-2008 05:30 PM
loop through field names, then use to loop through records topopulate grid pmacdiddie@gmail.com Access Forms Coding 1 01-04-2008 01:13 PM
loop through columns (using for-loop) Kurt Excel Programming 2 11-23-2007 08:56 PM
Loop through all folders in a mailbox Bob Smith Outlook VBA Programming 4 05-25-2006 10:23 PM
loop through selected folders in Calendar of Outlook 2003 Nick B Outlook VBA Programming 3 03-01-2005 06:48 PM


All times are GMT. The time now is 09:16 PM.
Microsoft Office Forums is not affiliated with Microsoft Corporation.


Welcome!
Welcome to the Microsoft Office Forums
 


Latest Threads
New user looking for shapes/templates
SargeUSMC (04-21-2014, 04:23 PM)

Mail Merging Content With High Quality
oleander (04-17-2014, 11:59 PM)

Aargh. What is this?
PeteJ (04-17-2014, 12:10 PM)

Word 2013 Insert Symbol (Not Responding)
tpthrshr (04-17-2014, 02:49 AM)

Can't save a large Word document
Josh (04-17-2014, 01:03 AM)