MapiProperty Class

A MAPI property of an object of an Outlook data file. The value is read when it is first accessed.

public sealed class MapiProperty

Properties

NameDescription
IdGets the identifier of the property.
NamedPropertyGets the name of the property when its identifier is in the range of the named properties (0x8000 and above) and the file maps it.
TagGets the tag of the property.
TypeGets the type of the property.
ValueGets the value of the property, as the .NET type documented by MapiPropertyType, or the raw bytes for the types that have no .NET equivalent.

Gets the identifier of the property.

public ushort Id { get; }

Property value

ushort

NamedProperty

MapiProperty.cs

Gets the name of the property when its identifier is in the range of the named properties (0x8000 and above) and the file maps it.

public MapiNamedProperty? NamedProperty { get; }

Property value

MapiNamedProperty?

Gets the tag of the property.

public MapiPropertyTag Tag { get; }

Property value

MapiPropertyTag

Gets the type of the property.

public MapiPropertyType Type { get; }

Property value

MapiPropertyType

Gets the value of the property, as the .NET type documented by MapiPropertyType, or the raw bytes for the types that have no .NET equivalent.

public object? Value { get; }

Property value

object?

Exceptions

InvalidEmailDataException
The value is malformed.
EmailResourceLimitException
The value is larger than PstReadOptions.MaxPropertySize.

Methods

NameDescription
GetBytes()Returns the bytes of the value, as stored in the file (UTF-16 for MapiPropertyType.Unicode).
GetSize()Gets the size of the value in bytes, as stored in the file.
OpenRead()Opens a stream on the bytes of the value. Large values are read block by block.
ToString()Returns the tag and the name of the property.

GetBytes()

MapiProperty.cs

Returns the bytes of the value, as stored in the file (UTF-16 for MapiPropertyType.Unicode).

public byte[] GetBytes()

Returns

byte[] The bytes of the value.

Exceptions

EmailResourceLimitException
The value is larger than PstReadOptions.MaxPropertySize.

Gets the size of the value in bytes, as stored in the file.

public long GetSize()

Returns

long The size of the value.

OpenRead()

MapiProperty.cs

Opens a stream on the bytes of the value. Large values are read block by block.

public Stream OpenRead()

Returns

Stream A read-only stream.

ToString()

MapiProperty.cs

Returns the tag and the name of the property.

public override string ToString()

Returns

string The tag and the name of the property.