MapiNamedProperty

MapiNamedProperty

Overview

Named MAPI properties extend the fixed MAPI property ID space by identifying properties with either a string name or a numeric long ID (LID) scoped to a property set UUID. MapiNamedProperty is a descriptor object — it does not hold a value itself, but serves as a key passed to MapiMessage.set_named_property() and get_named_property(). The well-known property set constants PS_MAPI and PS_PUBLIC_STRINGS are available in the aspose.email_foss.msg module.

from aspose.email_foss import msg

named = msg.MapiNamedProperty.string("CustomTag", msg.PS_PUBLIC_STRINGS)
message = msg.MapiMessage.create("Test", "Body")
message.set_named_property(named, msg.PropertyTypeCode.PTYP_STRING, "custom_value")
retrieved = message.get_named_property(named, msg.PropertyTypeCode.PTYP_STRING)
if retrieved:
    print(retrieved.value)

Class Methods

SignatureDescription
string(name, property_set=PS_PUBLIC_STRINGS) -> MapiNamedPropertyCreate a string-named property identifier in the given property set.
numeric(lid, property_set) -> MapiNamedPropertyCreate a numeric LID property identifier in the given property set.

Key Fields

NameTypeDescription
property_setuuid.UUIDUUID identifying the property set namespace.
kindstrEither "string" or "numeric".
namestr | NoneString name (when kind == "string").
lidint | NoneNumeric LID (when kind == "numeric").

See Also