Last modified: July 23, 2011

Applies to: Outlook

Describes a compare property restriction, which tests two properties using a relational operator.

Header file:


typedef struct _SComparePropsRestriction
  ULONG relop;
  ULONG ulPropTag1;
  ULONG ulPropTag2;
} SComparePropsRestriction;


Relational operator to use to compare the two properties. Possible values are as follows:


The comparison is made based on a greater or equal first value.


The comparison is made based on a greater first value.


The comparison is made based on a lesser or equal first value.


The comparison is made based on a lesser first value.


The comparison is made based on unequal values.


The comparison is made based on LIKE (regular expression) values.


The comparison is made based on equal values.


Property tag of the first property to be compared.


Property tag of the second property to be compared.

The comparison order is (property tag 1) (relational operator) (property tag 2). The properties to be compared must be of the same type. Attempting to compare properties of different types causes MAPI or the service provider to return the error value MAPI_E_TOO_COMPLEX from the IMAPITable method to which the structure is passed as a parameter.

The result of a compare property value restriction is undefined when one or both of the properties do not exist. When a client requires well-defined behavior for such a restriction and is not sure whether the property exists, (for example, it is not a required column of a table) it should create an AND restriction to join the compare property restriction with an exist restriction. Use an SExistRestriction structure to define the exist restriction and an SAndRestriction structure to define the AND restriction.

The properties specified in the ulPropTag1 and ulPropTag2 members can be multi-valued if the service provider supports it.

For more information about the SComparePropsRestriction structure and restrictions in general, see About Restrictions.