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

# MsgStorage

## Overview

`MsgStorage` is a named storage node within a `.msg` document tree with a semantic `Role` (message, recipient, attachment, or embedded message). It holds child `MsgStream` property streams and child `MsgStorage` sub-storages. Use `AddStream` and `AddStorage` to construct a document tree, and `FindStream`/`FindStorage` to locate named children when reading. Pass the completed root `MsgStorage` to `MsgWriter` to serialize the full document.

## Constructors

| Signature | Description |
|-----------|-------------|
| `MsgStorage(name: string, role: MsgStorageRole)` | Creates a new `MsgStorage` with the specified parameters. |

## Methods

| Signature | Description |
|-----------|-------------|
| `AddStream(stream: MsgStream)` | Adds `stream` as a child property stream of this storage. |
| `AddStorage(storage: MsgStorage)` | Adds `storage` as a child sub-storage of this storage. |
| `FindStream(name: string)` | Returns the `MsgStream` whose `Name` equals `name`, or `null` if not found. |
| `FindStorage(name: string)` | Returns the `MsgStorage` whose `Name` equals `name`, or `null` if not found. |

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `Name` | `string` | Read | CFB storage name for this node (e.g. `__substg1.0_0037001F` or `Root Entry`). |
| `Role` | `MsgStorageRole` | Read | Semantic role of this storage node as a `MsgStorageRole` value. |
| `Clsid` | `byte[]` | Read | 16-byte CLSID of this storage entry; zeros for most MSG storages. |
| `StateBits` | `uint` | Read | User-defined state bits stored in the CFB directory entry for this storage. |
| `CreationTime` | `ulong` | Read | CFB creation timestamp for this storage entry (64-bit FILETIME). |
| `ModifiedTime` | `ulong` | Read | CFB last-modification timestamp for this storage entry (64-bit FILETIME). |
| `Streams` | `IList<MsgStream>` | Read | Ordered list of `MsgStream` children of this storage. |
| `Storages` | `IList<MsgStorage>` | Read | Ordered list of `MsgStorage` child storages of this storage. |

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