Platform SDK: Exchange Server

Action CoClass

The Action COM class defines an object with properties that you can use to modify actions.

CLSID
40E6B497-0976-11D2-BC0F-00C04F8C92F7
ProgID
MSExchange.Action
Type Library
Microsoft Exchange 5.5 Rules Type Library 1.0 (Rule.dll)
Threading Model
Single-threaded apartment (STA)
Interfaces
The Action class exposes the IAction dual interface.

Remarks

Use the Action COM class to create an action to take when a rule condition is satisfied. The class defines an object with two properties: ActionType and Arg. The ActionType property specifies what action the rule should perform when the corresponding rule condition is satisfied The Arg property holds the information required to perform that particular action. The contents of the Arg property depend on the value of the ActionType property.

Example

The following example creates an action that moves messages to the Deleted Items folder.

const ACTION_MOVE  = 1

Set mySession = CreateObject("MAPI.Session")
mySession.Logon "","",false,true,true,true,"SERVER" & vbLF & "TestUser"

Set InfoStore = objSession.InfoStores (2)
Set myPrivateFs = InfoStore.RootFolder.Folders

For Each myFolder in myPrivateFs
  If myFolder.Name = "Deleted Items"
    ActionFolder = myFolder
    Exit For
  End If
Next

Set myAction        = CreateObject("MSExchange.Action")
myAction.ActionType = ACTION_MOVE
myAction.Arg        = ActionFolder
...