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

Move MailItem



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 21st 07, 12:29 AM posted to microsoft.public.outlook.program_vba
John Tripp
external usenet poster
 
Posts: 10
Default Move MailItem

In VBA Outlook 2003, I simply want a macro to run and pass through a inbox
subfolder ("X"), test to see if there is an attachment. If there is, I want
to move the mailitem to subfolder ("Y"). Is there a straightforward way to
do this? Thanks.
Ads
  #2  
Old June 21st 07, 07:07 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Move MailItem



You need to loop backwards through that folder's items (with a For i=Count
To 1 step-1 loop). A MailItem object has an Attachments property which in
turn has a Count property. If that propertie's value is 0 then call that
MailItem's Move method, which is explained in the VBA help.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize Outlook email:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Wed, 20 Jun 2007 15:29:48 -0700 schrieb John Tripp:

In VBA Outlook 2003, I simply want a macro to run and pass through a inbox
subfolder ("X"), test to see if there is an attachment. If there is, I

want
to move the mailitem to subfolder ("Y"). Is there a straightforward way

to
do this? Thanks.

  #3  
Old June 22nd 07, 06:07 AM posted to microsoft.public.outlook.program_vba
John Tripp
external usenet poster
 
Posts: 10
Default Move MailItem

Thanks, I got it working pretty well. The problem I was having was
When I input "mailitem.move" in word 2003 I got no matches.
I solved my problem by putting "mailitem.move" into word XP on a different
machine. Got all the syntax and got it working.

Thanks again

"Michael Bauer [MVP - Outlook]" wrote:



You need to loop backwards through that folder's items (with a For i=Count
To 1 step-1 loop). A MailItem object has an Attachments property which in
turn has a Count property. If that propertie's value is 0 then call that
MailItem's Move method, which is explained in the VBA help.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize Outlook email:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Wed, 20 Jun 2007 15:29:48 -0700 schrieb John Tripp:

In VBA Outlook 2003, I simply want a macro to run and pass through a inbox
subfolder ("X"), test to see if there is an attachment. If there is, I

want
to move the mailitem to subfolder ("Y"). Is there a straightforward way

to
do this? Thanks.


 




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
Delete MailItem j Add-ins for Outlook 5 January 25th 07 07:47 PM
MailItem.Move changes Received Date Frank Perugini Outlook and VBA 1 January 22nd 07 12:27 AM
MailItem.Move changes Received Date Frank Perugini Add-ins for Outlook 1 January 22nd 07 12:27 AM
MailItem flags Gary E. Outlook and VBA 8 January 18th 07 01:11 AM
How can I create a MailItem that displays like a received MailItem ? Clive Outlook - Using Forms 0 February 27th 06 05:14 PM


All times are GMT +1. The time now is 07:33 PM.


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.