Overview
MsgDocument is the mutable in-memory model of an Outlook MSG file at the storage level. It is one abstraction layer below MapiMessage: instead of named properties and typed recipients, you work directly with MsgStorage nodes and raw property streams. Load it with from_file() or from_reader(), manipulate the root storage tree, and write it back with MsgWriter. Convert up to a MapiMessage via MapiMessage.from_msg_document() when higher-level access is needed.
Class Methods
| Signature | Description |
|---|
from_reader(reader) -> MsgDocument | Build an MsgDocument from an open MsgReader. |
from_file(path, strict=False) -> MsgDocument | Open a .msg file and parse it into an MsgDocument. |
Key Fields
| Name | Type | Description |
|---|
root | MsgStorage | Root storage node of the MSG hierarchy. |
major_version | int | CFB major version from the file header. |
minor_version | int | CFB minor version from the file header. |
transaction_signature_number | int | MSG transaction signature. |
strict | bool | Whether the document was loaded in strict mode. |
Methods
| Signature | Description |
|---|
to_cfb_document() -> CFBDocument | Convert this MsgDocument to a low-level CFBDocument for direct CFB manipulation. |
build_storage(entry, role) -> MsgStorage | Wrap a DirectoryEntry as a typed MsgStorage node with the given role. |
See Also