[]
Represents a Custom XML part in a workbook.
A Custom XML part stores an arbitrary XML payload as raw bytes in the workbook package. The part is identified by a generated ID that is persisted with the workbook and can be used to retrieve the part after reopening the file.
public interface ICustomXmlPart
Public Interface ICustomXmlPart
ICustomXmlPart customXmlPart = workbook.CustomXmlParts.Add();
customXmlPart.Data = System.Text.Encoding.UTF8.GetBytes("<order><id>1001</id></order>");
string id = customXmlPart.Id;
byte[] xmlData = customXmlPart.Data;
| Name | Description |
|---|---|
| Data | Gets or sets the raw data stored in the Custom XML part. The returned byte array is a copy of the stored data. Modifying the returned array does not change the content of the Custom XML part. To update the part content, assign this property. The provided byte array is copied into the Custom XML part and persisted as the XML payload when the workbook is saved to an OpenXML workbook format. |
| Id | Gets the unique ID of the Custom XML part. The ID is generated when the part is added to the workbook and is stored in the Custom XML part properties. Use this value with this[string] to retrieve the same part after the workbook is saved and reopened. |