---
Product: Aspose.Email
Platform: net
Page Type: reference
Canonical URL: https://reference.aspose.org/email/net/msg-document
---

# 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

| Signature | Description |
|-----------|-------------|
| `MsgDocument(root: MsgStorage, majorVersion: ushort, minorVersion: ushort, transactionSignatureNumber: uint, strict: bool)` | Creates a new `MsgDocument` with the specified parameters. |

## Methods

| Signature | Description |
|-----------|-------------|
| `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

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `Root` | `MsgStorage` | Read | The root `MsgStorage` node of the message tree. |
| `MajorVersion` | `ushort` | Read | CFB major version parsed from the file header. |
| `MinorVersion` | `ushort` | Read | CFB minor version parsed from the file header. |
| `TransactionSignatureNumber` | `uint` | Read | CFB transaction signature number from the file header. |
| `Strict` | `bool` | Read | True if strict validation was requested when this document was loaded. |

## See Also
- [Aspose.Email for .NET — Enterprise API Reference](https://reference.aspose.com/email/net/)