## Save(string, MessageObjectSaveFormat) {#save_1}

Saves the current message object to the specified file.

```csharp
public void Save(string fileName, MessageObjectSaveFormat format)
```

| Parameter | Type | Description |
| --- | --- | --- |
| fileName | String | Name of the file. |
| format | MessageObjectSaveFormat | The format of the output data. |

### Exceptions

| exception | condition |
| --- | --- |
| ArgumentOutOfRangeException | If *format* value is not valid. |

## Remarks

In addition same set of exceptions could be thrown as for the String) call.

### See Also

* enum [MessageObjectSaveFormat](../../messageobjectsaveformat/)
* class [MessageObject](../)
* namespace [Aspose.Email.Mapi.Msg](../../messageobject/)
* assembly [Aspose.Email](../../../)

---

## Save(Stream, MessageObjectSaveFormat) {#save}

Saves the current message object to the specified stream.

```csharp
public void Save(Stream stream, MessageObjectSaveFormat format)
```

| Parameter | Type | Description |
| --- | --- | --- |
| stream | Stream | The stream to write to. |
| format | MessageObjectSaveFormat | The format of the output data. |

### Exceptions

| exception | condition |
| --- | --- |
| ArgumentNullException | If *stream* is null. |
| ArgumentOutOfRangeException | If *format* value is not valid. |

### See Also

* enum [MessageObjectSaveFormat](../../messageobjectsaveformat/)
* class [MessageObject](../)
* namespace [Aspose.Email.Mapi.Msg](../../messageobject/)
* assembly [Aspose.Email](../../../)


