Working with MAPI Properties

Accessing and Setting Outlook MAPI Property

The MapiProperty class represents a MAPI property, which contains:

  • Name: a string that represents the property’s name.
  • Tag: a long that represents the property’s tag.
  • Data: a byte array which represents the property’s data.

Getting MAPI Property using the MAPI Property Tag

To get MAPI properties:

  1. Create an instance of MapiMessage by loading from files or stream.
  2. Get the MapiProperty from MapiMessage.Properties by MapiPropertyTag keys.
  3. Get the Data of the MapiProperty by method GetX.

The following code snippet shows you how to get MAPI property using the MAPI property tag.

Setting MAPI Properties

The following code snippet shows you how to set MAPI properties.

where the definition of convertDateTime method is as follow: