Platform SDK: Exchange Server

LogicalCondition CoClass

The LogicalCondition COM class defines an object that you can use to create a binary or unary logical condition. This class supports the AND and OR binary conditions and the NOT unary condition.

CLSID
95525546-095F-11D2-BC0F-00C04F8C92F7
ProgID
MSExchange.LogicalCondition
Type Library
Microsoft Exchange 5.5 Rules Type Library 1.0 (Rule.dll)
Threading Model
Single-threaded apartment (STA)
Interfaces
The LogicalCondition class exposes the ILogicalCondition dual interface.

Overview

Use the LogicalCondition object to negate a condition or logically group multiple conditions.

Example

The following example creates a condition that identifies messages with the word "Delete" in the Subject line and also marked with low importance.

const CdoPR_SUBJECT = &H0037001E
const FULLSTRING    = 0

Set objPropVal   = CreateObject("MSExchange.PropertyValue")
objPropVal.Tag   = CdoPR_SUBJECT
objPropVal.Value = "Delete"

Set objContCond          = CreateObject("MSExchange.ContentCondition")
objContCond.Value        = objPropVal
objContCond.PropertyType = CdoPR_SUBJECT
objContCond.Operator     = FULLSTRING

Set importPropVal   = CreateObject("MSExchange.PropertyValue")
importPropVal.Tag   = CdoPR_IMPORTANCE
importPropVal.Value = IMPORTANCE_LOW

Set importPropCond         = CreateObject("MSExchange.PropertyCondition")
importPropCond.PropertyTag = CdoPR_IMPORTANCE
importPropCond.Operator    = REL_EQ
importPropCond.Value       = importPropVal

Set logProp      = CreateObject("MSExchange.LogicalCondition")
logProp.Operator = L_AND
logProp.Add        , objContCond
logProp.Add        , importPropCond
...