commands for moving an email




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.



Michael Bauer [MVP - Outlook]

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

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:

Am Thu, 26 Jul 2007 21:44:07 -0700 schrieb Kevin Maher:

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