Macro for deleting email by date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

what would the code be for writing a macro to auto delte emails older than 7
days?
 
Please see the sample for the Restrict function in your VBA help file. You
can loop backwards through the resulting Items collection and call each
item's Delete method. A backwards loop looks like this:

Dim i&
Dim Items as Outlook.Items
Dim obj as Object

For i=Items.Count to 1 Step-1
set obj=Items(i)
obj.Delete
Next

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Thu, 27 Sep 2007 14:34:00 -0700 schrieb dcallaway:
 

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

Back
Top