MapiPropertyCollection
Overview
MapiPropertyCollection is a keyed container of MapiProperty objects attached to a MapiMessage, MapiRecipient, or MapiAttachment. It provides dictionary-like semantics for setting, retrieving, and removing properties by property ID, and supports full iteration over all entries. Modifying the collection directly is an alternative to calling set_property() / get_property() on the parent object.
from aspose.email_foss import msg
message = msg.MapiMessage.create("Test", "Body")
props = message.properties
for p in props.iter_properties():
print(f"0x{p.property_tag:08X} = {p.value!r}")Methods
| Signature | Description |
|---|---|
set(property) -> MapiProperty | Insert or replace a MapiProperty in the collection. |
add(property_id, property_type, value, flags=..., named=None) -> MapiProperty | Build a new MapiProperty from components and add it. |
get(property_id, property_type=None) -> MapiProperty | None | Look up a property by ID, optionally filtered by type. |
remove(property_id, property_type=None) -> None | Remove a property from the collection. |
iter_properties() -> Iterator[MapiProperty] | Iterate over all MapiProperty entries. |