Outlook 2003/2007 Rule and Conditions for InBox VBA customization
Thank you Ken. Looks like I'll need to do some research and amalgamation of
techniques etc., the guideposts you suggested help .
Should there not be a way in which I could derive and enhance existing forms
and values and dialogs to add what I want?, ie: I wonder if I can wrap/derive
extend existing classes in Outlook Rules Wizard (Start from Blank rule) (and
add) a timer event so rule wizard lists "Check item in this folder Daily" ,
and Conditions for testing in Macro's Ie add a condition "If item is unread"
and condition "If Item is older than n days" . I guess the timer even routine
would need to examine the rules tree, etc...
Perhaps I should investigate a C# Plugin and add Timer etc.. And new
dialogs etc. It would just seem better to use existing UI and just add the
extensions to the existing UI and classes and selection string values etc...
I'll look at Outlook 2007 Rule Object model and probably only Outlook 2007
and later .
"GreyCoderII" wrote:
I would like Outlook to periodically examine my inbox items to do some
automated cleanup. Unfortunately the basic functionality of Rules Wizard does
not provide the two Conditions and Time interval setting I need to test to
apply an action. So I believe I must write a VBA Script to perform the
actions.
Outlook (out of the box) seems to be missing ability to set conditions on
any of the MailBoxItem properties (only some...) , and is missing a Check
Messages Periodically interval where Check either when arrive or when sent
exists.
I want to daily (After midnight) check all InBox items that are from certain
addresses (condition for rule exists), AND where the Item Property is
MailBoxItem.UnRead (does not exist in selection conditions presently) , and
the Item.DateReceived is 7 days from todays date ie: item is older than 7
days, and then Move the item to another folder (Action can be set in current
Rules choices)
I am not VB/VBA programmer but I have done a little VB work , There are no
samples (or MS documentation) around that define all of the pieces I require
to write the Macro.
1) How to define and add new Conditions to existing Outlook Rule condition
choices?
2) How to Return a Boolean result from a Macro to be used in Rule condition
/action testing? ie: Return (Item.UnRead = True) ?? probably obvious to a VB
programmer .
3) What are the arguments required I assume MailBoxItem is passed as input
argument to all VBA Macros/Scripts called from OutLook client, it's weakly
documented.
4) How to set Rule execution interval to daily , and Inbox iteration?
5) What are all the properties of MailBoxItem ( I actually think it's out
there in bits and pieces.) I found UnR
6) What is the environment the VBA rule runs under ie: Context is already in
Application.Inspector or something or do all objects
Outlook/Application/Inspector etc.. need definition (Dim... As) as well as
Set (... = ???) for useage (This is probably obvious to a VB programmer..
Perhaps I will have to write an extension or Add in instead ?? seems silly
... but.
Any help on how to write a rule to do what I want is appreciated.
GC
|