Help!

commands for moving an email

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA RSS
Next:  Save and Remove Attachment  
Author Message
Kevin Maher
External


Since: Jul 26, 2007
Posts: 4



PostPosted: Thu Jul 26, 2007 9:44 pm    Post subject: commands for moving an email
Archived from groups: microsoft>public>outlook>program_vba (more info?)

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
Back to top
Michael Bauer [MVP - Outl
External


Since: Aug 04, 2006
Posts: 647



PostPosted: Fri Jul 27, 2007 2:15 am    Post subject: Re: commands for moving an email [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
Back to top
Kevin Maher
External


Since: Jul 26, 2007
Posts: 4



PostPosted: Fri Jul 27, 2007 2:16 am    Post subject: Re: commands for moving an email [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
>
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum