# GrapeCity.Documents.Excel.IWorkbook.CustomXmlParts

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_IWorkbook_CustomXmlParts_" data-uid="GrapeCity.Documents.Excel.IWorkbook.CustomXmlParts*">CustomXmlParts Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_IWorkbook_CustomXmlParts_" data-uid="GrapeCity.Documents.Excel.IWorkbook.CustomXmlParts*"></a>
<h4 id="GrapeCity_Documents_Excel_IWorkbook_CustomXmlParts" data-uid="GrapeCity.Documents.Excel.IWorkbook.CustomXmlParts">CustomXmlParts</h4>
<div class="markdown level1 summary"><p>Gets the collection of Custom XML parts in the workbook.</p>
<p>
Use the returned <a class="xref" href="GrapeCity.Documents.Excel.ICustomXmlPartCollection.html">ICustomXmlPartCollection</a> to add, retrieve, enumerate, or remove
workbook-level Custom XML parts. Custom XML parts are stored in the OpenXML package as raw XML
payloads and are preserved when saving to OpenXML workbook formats such as XLSX and XLSM.
</p><p>
This API stores and returns the XML bytes only. It does not validate the XML against a schema.
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">ICustomXmlPartCollection CustomXmlParts { get; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">ReadOnly Property CustomXmlParts As ICustomXmlPartCollection</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Excel.ICustomXmlPartCollection.html">ICustomXmlPartCollection</a></td>
      <td><p>The collection of Custom XML parts in the workbook.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Documents_Excel_IWorkbook_CustomXmlParts_examples">Examples</h5>
<pre><code class="lang-csharp">Workbook workbook = new Workbook();
ICustomXmlPart customXmlPart = workbook.CustomXmlParts.Add();
customXmlPart.Data = System.Text.Encoding.UTF8.GetBytes("&lt;payload&gt;&lt;customer id=\"42\"/&gt;&lt;/payload&gt;");
string customXmlPartId = customXmlPart.Id;

ICustomXmlPart samePart = workbook.CustomXmlParts[customXmlPartId];
byte[] xmlData = samePart.Data;</code></pre>

</div>
