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 / September 2005

Tip: Looking for answers? Try searching our database.

Move a flagged mail to a folder and forward it to a distribution l

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
deep4u - 23 Sep 2005 17:02 GMT
I need to Move a flagged mail to a folder and forward it to a distribution
list automatically.
I can create a rule to mve and forward the mail if the mail is a new one.
But I want the rule to be triggered when I flag the mail.
I tried to use the VBA for outlook, but still am unable to do it.
Please help.
Signature

Thanks,
D:-)

Eric Legault [MVP - Outlook] - 26 Sep 2005 20:46 GMT
You can't run a rule programmatically, unless you are referring to a macro
that is run by the "Run a script" option of a rule.

Regardless, you would have to monitor the MailItem_PropertyChange event and
trap when the FlagStatus property has changed (to olFlagMarked).

See this article for an explanation of how to do this:

Getting a Handle on Your E-mails with VBA:
http://blogs.officezealot.com/legault/articles/2224.aspx

However, you'll have to go further still.  The code above is only good if
the user has opened the e-mail.  Remember, you can flag a message in the
folder view.  So to trap that, you'll need to monitor the
Explorer_SelectionChange event to get a handle to individual Inspectors as
the user selects them; then you monitor each of the items selected for the
PropertyChange event.  This is best handled using an Inspector Wrapper:

Slovak Technical Services Code Samples:
http://www.slovaktech.com/code_samples.htm#InspectorWrapper

Signature

Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/

> I need to Move a flagged mail to a folder and forward it to a distribution
> list automatically.
> I can create a rule to mve and forward the mail if the mail is a new one.
> But I want the rule to be triggered when I flag the mail.
> I tried to use the VBA for outlook, but still am unable to do it.
> Please help.
 
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.