MsgDocument

Overview

MsgDocument represents a parsed .msg file as a tree of MsgStorage nodes. Load an existing file with FromFile or FromStream, then navigate Root.Storages and Root.Streams to access the MAPI data. Call ToCfbDocument to convert the MSG document back to a raw CfbDocument for low-level inspection or re-serialization with CfbWriter. The Strict flag controls whether structural validation errors are raised or silently recorded.

Constructors

SignatureDescription
MsgDocument(root: MsgStorage, majorVersion: ushort, minorVersion: ushort, transactionSignatureNumber: uint, strict: bool)Creates a new MsgDocument with the specified parameters.

Methods

SignatureDescription
FromFile(path: string, strict: bool)Loads a MsgDocument from the .msg file at path; strict enables structural validation.
FromStream(stream: Stream, strict: bool)Loads a MsgDocument from stream; strict enables structural validation.
ToCfbDocument()Converts this MsgDocument to a raw CfbDocument for low-level inspection or re-serialization.

Properties

NameTypeAccessDescription
RootMsgStorageReadThe root MsgStorage node of the message tree.
MajorVersionushortReadCFB major version parsed from the file header.
MinorVersionushortReadCFB minor version parsed from the file header.
TransactionSignatureNumberuintReadCFB transaction signature number from the file header.
StrictboolReadTrue if strict validation was requested when this document was loaded.

See Also