## MapiAttachmentCollection.Replace method

Replaces the attachment at the specified position with an embedded message.

```csharp
public void Replace(int index, string name, MapiMessage msg)
```

| Parameter | Type | Description |
| --- | --- | --- |
| index | Int32 | The zero-based position of the attachment to replace. |
| name | String | The name of the new attachment. |
| msg | MapiMessage | The message to attach. |

### Exceptions

| exception | condition |
| --- | --- |
| ArgumentNullException | *msg* is `null`. |

### See Also

* class [MapiMessage](../../mapimessage/)
* class [MapiAttachmentCollection](../)
* namespace [Aspose.Email.Mapi](../../mapiattachmentcollection/)
* assembly [Aspose.Email](../../../)


