[]
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.
byte[] Data { get; set; }
Property Data As Byte()
| Type | Description |
|---|---|
| byte[] | The raw data stored in the Custom XML part. |
ICustomXmlPart customXmlPart = workbook.CustomXmlParts.Add();
byte[] xmlData = System.Text.Encoding.UTF8.GetBytes("<settings><enabled>true</enabled></settings>");
customXmlPart.Data = xmlData;
byte[] storedXmlData = customXmlPart.Data;