Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / July 2007

Tip: Looking for answers? Try searching our database.

commands for moving an email

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin Maher - 27 Jul 2007 05:44 GMT
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
Michael Bauer [MVP - Outlook] - 27 Jul 2007 06:22 GMT
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.

Signature

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:

> Hi
>
[quoted text clipped - 9 lines]
>
> Kevin
Kevin Maher - 27 Jul 2007 06:40 GMT
I'll give that a try.  Thanks for pointing me in the right direction.

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:
[quoted text clipped - 21 lines]
> >
> > Kevin
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.