Save messages and attachments for a date range

P

PJFry

My company only lets us keep our e-mail in our inbox for three months, then
they are archived. Retrieving those archives requires the promise of your
first born. I am looking for code that will allow me to enter a date range
and have all the e-mails and attachments saved to my local drive as *.msg
files. I want to be able to perform this action on which ever folder is
active.

Any thoughts?

PJ
 
M

Michael Bauer [MVP - Outlook]

the active folder is Application.ActiveExplorer.CurrentFolder

Loop through the folder's Items collection, check each item's property
(ReceivedTime, CreationTime, LastModificationTime, or whatever you're
looking for), and for the matching items call the SaveAs method, which is
explained in the VBA help file.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Tue, 14 Apr 2009 09:42:01 -0700 schrieb PJFry:
 
P

PJFry

The Application.ActiveExplorer.CurrentFolder was the missing piece.

Thanks!
--
Regards,

PJ
Please rate this post using the vote buttons if it was helpful.
 

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