RDOClientRule object

 

RDOClientRule object represents a cliend-side rule object used by Outlook .

 

Returned by:

RDOClientRules.Item / GetFirst / GetLast / GetNext / GetPrevious / Create

 

The example below creates a new client rule that moves received messages from a particular sender unless the subject contains predefined keywords.

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

set colRules = Session.Stores.DefaultStore.ClientRules

Set oRule = colRules.Create("Test rule", olRuleReceive)

'Specify the condition in a ToOrFromRuleCondition object

'Condition is if the message is sent by "test@dimastr.com"

Set oFromCondition = oRule.Conditions.From

With oFromCondition

  .Enabled = True

  .Recipients.AddEx "Joe The User", "test@dimastr.com", "SMTP"

End With

'Specify the action in a MoveOrCopyRuleAction object

'Action is to move the message to the target folder

set oMoveTarget = Session.Stores.DefaultFolder(olFolderInbox).Folders.OpenOrAdd("Test folder")

Set oMoveRuleAction = oRule.Actions.MoveToFolder

With oMoveRuleAction

  .Enabled = True

  .Folder = oMoveTarget

 End With

'Specify the exception condition for the subject in a TextRuleCondition object

'Exception condition is if the subject contains "fun" or "chat"

Set oExceptSubject = oRule.Exceptions.Subject

With oExceptSubject

  .Enabled = True

  .Text = Array("fun", "chat")

End With

'Update the rules

colRules.Save

 

Properties

 


Derived from: IDispatch


Properties


Actions
Returns an RDOClientRuleActions collection object that represents all the available rule actions for the rule. Read-only.
 
Conditions
Returns a RDOClientRuleConditions collection object that represents all the available rule conditions for the rule. Read-only.
 
Enabled
Returns or sets a Boolean value that determines if the rule is to be applied. Read/write.
 
Exceptions
Returns a RDOClientRuleConditions collection object that represents all the available rule exception conditions for the rule. Read-only.
 
ExecutionOrder
Returns or sets a Long that indicates the order of execution of the rule among other rules in the RDOClientRules collection. Read/write.
 
IsLocalRule
Returns a Boolean that indicates if the rule executes as a client-side rule. Read-only.
 
Name
Returns or sets a String representing the name of the rule. Read/write.
 
RuleType
Returns a constant from the rdoRuleType enumeration that indicates if the rule applies to messages that are being sent or received. Read-only.

olRuleReceive = 0
olRuleSend = 1