RDORules object

 

RDORules collection represents the list of rules from a particular Exchange mailbox.

Important note: rules created by RDORules are not visible in Outlook (Tools | Rules and Alerts). RDORules collection only works with the Exchange Server rules; it cannot access and manipulate local rules (such as those used by a PST store).

 

Returned by:

RDOExchangeMailboxStore.Rules

 

The example below enumerates all rules in the default store and prints out their names. If the store is other than an Exchange mailbox (such as PST), an error will be raised.

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Rules = Session.Stores.DefaultStore.Rules 'will raise an error if not an Exchange store
for each Rule in Rules
  Debug.Print Rule.Name
next

 

Properties

Methods

 


Derived from: IDispatch


Properties


Count

Integer, read-only. Returns the number of rules in the collection.

 

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Rules = Session.Stores.DefaultStore.Rules 'will raise an error if not an Exchange store

MsgBox "There are " & Rules.Count & " in the default mailbox"

 

Create(Name)

Creates and returns a new rule (RDORule) with the specified name.

 

'Create a rule that marks all incoming messages as read

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Rules = Session.Stores.DefaultStore.Rules 'will raise an error if not an Exchange store
set Rule = Rules.Create("Mark As Read Rule")
set Action = Rule.Actions.MarkAsRead 'a predefined action which might not yet exist
Action.Enabled = true
Rule.Save

 

_Item[Index]

Returns RDORule object with the given index.

Default object property.

 

Index - variant. Either an integer (1 through Count) or a string representing the rule name.
 

 

MAPITable

MAPITable, read-only. Returns the MAPITable Redemption object which can be used to manipulate the collection (restrict, find, etc).

 

 

RawTable

IUnknown, read-only. Returns the IMAPITable Extended MAPI interface used internally by the RDORules collection.

 

 

Methods


GetFirst

Returns the first rule in the specified RDORules collection. Returns Nothing if no first rule exists, for example, if there are no rules.

 

 

GetLast

Returns the last rule in the specified RDORules collection. Returns Nothing if no last rule exists, for example, if there are no rules.

 

 

 

GetNext

Returns the next rule in the specified RDORules collection. It returns Nothing if no next rule exists, for example, if already positioned at the end of the collection.

 

 

GetPrevious

Returns the previous rule in the specified RDORules collection. It returns Nothing if no previous rule exists, for example, if already positioned at the beginning of the collection.

 

 

Item(Index)

Returns RDORule object with the given index.

 

Index - variant. Either an integer (1 through Count) or a string representing the rule name.
 

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Rules = Session.Stores.DefaultStore.Rules 'will raise an error if not an Exchange store
for i = 1 to Rules.Count
  Debug.Print Rules.Item(i).Name
next

 

Remove(Index)

Removes the rule with the given index.

 

Index - variant. Either an integer (1 through Count) or a string representing the rule name.