commands for moving an email

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

Guest

Hi

Can someone please tell me the VB commands to go through each folder in my
mailbox, and move any item larger than a certain size (e.g. 250KB) to the
folder with the same name in my archive?

I frequently fill up my inbox space quota, and find physically moving large
items to the archive to be time-consuming. Auto-archive only works with
dates, not email size - hence why I'm asking the above question.

Regards

Kevin
 
Kevin, there's not one single command. Loop through the Items collection of
that folder with a backwards running For-Next loop, which looks like this:

For i=Items.Count To 1 Step-1
....
Next

In the loop check each MailItem's Size property, it tells you the size in
Byte. For moving an item call its Move function and pass a variable with the
target folder. That function is explained in the VBA help.

--
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, 26 Jul 2007 21:44:07 -0700 schrieb Kevin Maher:
 
Back
Top