VBA to copy messages from folders & subfolders to single folder

C

Curious Joe

I have 48 folders in a public folder. Each folder may have multiple
subfolders. I need to write a vba macro/script that will accept the
"top" folder as a parameter and walk through all of its subfolders
copying every message to a main folder.

For example...

Public Folders -> All Public Folders -> Problem Child is where all of
my "top" folders reside. One of those is named "Curious Joe" and it
has many subfolders under it. I need the script to accept "Curious
Joe" as the parameter. Then it needs to traverse all subfolders of
"Curious Joe" and copy every message from all subfolders to Public
Folders -> All Public Folders -> MergedMail

Thanks for any help you can give,

CJ
 
M

Michael Bauer [MVP - Outlook]

You might use this sample to start, it demos how to loop through folders:
http://www.vboffice.net/sample.html?mnu=2&smp=12&cmd=showitem&lang=en&pub=6

You could use the Pickfolder function twice, once to get the top source
folder (then pass the result's Folders collection to the LoopFolders
procedure) and once for the destination folder to copy the items into.

If you need more help, please post to microsoft.public.outlook.program_vba
as this is no group for programming issues.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Synchronize Color Categories & Ensure that Every Item Gets Categorized:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Wed, 31 Oct 2007 13:52:19 -0700 schrieb Curious Joe:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top