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

Tags: , , , , ,

VBA to move outbound email and mark as read?





 
 
Thread Tools Display Modes
  #11  
Old May 2nd 06, 02:50 PM posted to microsoft.public.outlook.program_vba
ajkessel@gmail.com
external usenet poster
 
Posts: 10
Default VBA to move outbound email and mark as read?

I don't really understand the confusion--if the script is just another
action like the other outbound rule actions, wouldn't it just run
against the item in the same way all the other actions run against the
item?

In any case, I have tweaked together a solution that seems to work,
which basically involves avoided rules all together. All pattern
matching on the outgoing is done in VBA rather than with a rule. This
seems to be the only practical way to accomplish what I would think
would be a common scenario: moving outbound messages to folders by
pattern matching and marking them as "read" when they are moved to the
outbound folder. (If you just use the rule to move to an outbound
folder, they appear as unread in the outbound folders--and unless you
set up an event handler for each and every outbound folder, there does
not seem to be any systematic rules based way to mark them as read when
they arrive in those folders.)

Ads
  #12  
Old May 2nd 06, 04:07 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default VBA to move outbound email and mark as read?

But it's not just another action. The rules wizard does not support a "run a script" action for rules on outgoing messages, most likely for the reasons I described. Items that are in the process of being sent and those that have already been sent are not identical.

But back to your scenario. It sounds like the best solution would be to stick solely with VBA code that monitors the Send Items folder for new items and then moves them based on your criteria and marks the moved copies as read.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in message oups.com...
I don't really understand the confusion--if the script is just another
action like the other outbound rule actions, wouldn't it just run
against the item in the same way all the other actions run against the
item?

In any case, I have tweaked together a solution that seems to work,
which basically involves avoided rules all together. All pattern
matching on the outgoing is done in VBA rather than with a rule. This
seems to be the only practical way to accomplish what I would think
would be a common scenario: moving outbound messages to folders by
pattern matching and marking them as "read" when they are moved to the
outbound folder. (If you just use the rule to move to an outbound
folder, they appear as unread in the outbound folders--and unless you
set up an event handler for each and every outbound folder, there does
not seem to be any systematic rules based way to mark them as read when
they arrive in those folders.)

"Sue Mosher [MVP-Outlook]" wrote in message ...
Just guessing, it's to avoid confusion and problems related to whether the rule script would run against the item before the send is completed or after.

Code for outgoing items can be handled by the Application_ItemSend event handler or by monitoring the Sent Items folder for new items with the MAPIFolder.Items.ItemAdd event, depending on the application.

wrote in message oups.com...
I think the problem is that "run a script" is available as an action in
a rule to process incoming mail, but not outgoing mail. Is there some
reason for this difference?

 




Thread Tools
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
Rule to Move to Folder AFTER being Read yelnocer Outlook - Installation 1 March 13th 06 12:40 AM
Using VBA code to move current message to a folder Dean Outlook and VBA 4 February 26th 06 02:46 AM
Mark as read Sven Berg Outlook - General Queries 1 February 8th 06 10:20 AM
Outlook 2003 - automatically mark all Junk email as "read" Ric Outlook - General Queries 8 January 19th 06 02:52 PM
Mark as Read? After x seconds? HotRod Outlook - General Queries 2 January 12th 06 08:22 PM


All times are GMT +1. The time now is 01:34 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Credit Card - Debt Consolidation - Credit Card Consolidation - Credit Card Consolidation - Loan