Save messages and attachments for a date range

  • Thread starter UEpGcnk
  • Start date Views 1,317
U

UEpGcnk

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
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
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

Am Tue, 14 Apr 2009 09:42:01 -0700 schrieb 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
 
U

UEpGcnk

The Application.ActiveExplorer.CurrentFolder was the missing piece.

Thanks!

Regards,

PJ

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

"Michael Bauer " wrote:



> 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

> > >

> Am Tue, 14 Apr 2009 09:42:01 -0700 schrieb 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

>
 

Top