[]
Gets the Custom XML part with the specified ID.
The ID is the value returned by Id. This lookup is useful after a workbook is reopened or when multiple Custom XML parts are stored in the same workbook.
ICustomXmlPart this[string id] { get; }
ReadOnly Default Property Item(id As String) As ICustomXmlPart
| Type | Name | Description |
|---|---|---|
| string | id | The ID of the Custom XML part. |
| Type | Description |
|---|---|
| ICustomXmlPart | The Custom XML part with the specified ID, or null if it is not found. |
ICustomXmlPart customXmlPart = workbook.CustomXmlParts.Add();
string id = customXmlPart.Id;
ICustomXmlPart samePart = workbook.CustomXmlParts[id];
Gets the Custom XML part at the specified zero-based index.
Use the index to enumerate or access parts in collection order. If the index is outside the valid range, an ArgumentOutOfRangeException is thrown.
ICustomXmlPart this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As ICustomXmlPart
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index of the Custom XML part. |
| Type | Description |
|---|---|
| ICustomXmlPart | The Custom XML part at the specified index. |
if (workbook.CustomXmlParts.Count > 0)
{
ICustomXmlPart firstPart = workbook.CustomXmlParts[0];
byte[] xmlData = firstPart.Data;
}
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when |