About Patterns

A pattern object is an object specifying rendering information for a particular set of values of a property on the object being rendered. Each format contains zero or more pattern objects, and each pattern is associated with a specific MAPI property value being rendered.

Pattern objects control the output of the associated MAPI property values by substituting the designated RenderUsing string if a match is found. The Pattern.Value property accepts any VARIANT type, but it is normally set to a string value. If the MAPI property value being matched contains a nonstring type, the Pattern.Value VARIANT is coerced to that type and a test for equality is performed.

The supported nonstring property types are PT_BOOLEAN, PT_I2, PT_LONG, and PT_BINARY. If the MAPI property is PT_UNICODE, it is matched against the BSTR equivalent of the pattern's value VARIANT using the WILDMAT matching standard, described in the section Pattern Matching. If no match is found, or if no patterns are defined for the format, the property is rendered by type, as illustrated in the following table.

Default Output Styles of Supported Property Types

Property type Rendered value
PT_UNICODE String is rendered verbatim.
PT_MV_UNICODE Renders all strings separated by a semicolon (;) and a space.
PT_SYSTIME Shortened date format followed by time without seconds (localized by LCID).
PT_R4 Rendered as a stringized float value (localized by LCID).
PT_DOUBLE Rendered as a stringized double value (localized by LCID).
PT_BOOLEAN Renders 1 for True, 0 for False.
PT_LONG
PT_I2
Rendered as a stringized long integer value.
PT_ERROR Ignored if error is MAPI_E_NOT_FOUND, otherwise assumed to be a PT_OBJECT type, which is retrieved with OpenProperty. Rendered as Unicode string or a hexized binary string, depending on object type.
PT_NULL No output.

The exceptions to this default property-type handling are listed in the following table.

Rendering Support for Special Properties

Property Rendered value
PR_ENTRYID
PR_LONGTERM_ENTRYID_FROM_TABLE
Hexized binary string.
PR_BODY
PR_RTF_COMPRESSED
Invokes RTF2HTML conversion engine.
PR_ATTACH_DATA_BIN Sends MIME data to output stream, or creates a link to public folder object. Currently only supports ATTACH_BY_VALUE attachment method.

All other property types are not supported.