A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

commands for moving an email



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 27th 07, 06:44 AM posted to microsoft.public.outlook.program_vba
Kevin Maher
external usenet poster
 
Posts: 2
Default commands for moving an email

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
  #2  
Old July 27th 07, 07:22 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default commands for moving an email



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:

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

  #3  
Old July 27th 07, 07:40 AM posted to microsoft.public.outlook.program_vba
Kevin Maher
external usenet poster
 
Posts: 2
Default commands for moving an email

I'll give that a try. Thanks for pointing me in the right direction.

Kevin

"Michael Bauer [MVP - Outlook]" wrote:



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:

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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Outlook 2007 slow to execute commands Source unavailable Outlook - Installation 2 June 1st 07 10:50 PM
How do I enable the disabled commands in Outlook 2007? Kenred Outlook - Installation 1 December 10th 06 09:13 PM
How do I get rid of the HTML commands in my messages Shasta Outlook - General Queries 2 June 4th 06 08:40 PM
Outlook commands [email protected] Outlook and VBA 10 March 28th 06 12:41 AM
how do Visual Basic Application (VBA) commands work Jason Outlook and VBA 2 January 10th 06 10:50 AM


All times are GMT +1. The time now is 07:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.