| Platform SDK: Exchange Server |
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.
Use the LogicalCondition object to negate a condition or logically group multiple conditions.
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
...