Custom Xml add string without asking for parts name

I am looking for a way to replicate this Interop method:
public Microsoft.Office.Core.CustomXMLPart Add (string XML = “”, object SchemaCollection);
(link)

The problem I am solving:
I have a custom XML file taken out from an Excel workbook. Now I want to put the exact same content into another workbook. With Interop, I can read the content from the XML file and add the exact content into the new workbook with the Add(string content) method.

However, when I was researching online for an equivalent method in Aspose, I couldn’t find one. All Aspose methods require me to input the id as well as the XML of the content (link).

Could anyone help, please?

@Sophia_Wang,

Your link (to Aspose API) is referring to Aspose.Words API page instead of Aspose.Cells API page.

See the documents for your reference.
https://docs.aspose.com/cells/net/add-custom-xml-parts-and-select-them-by-id/
https://docs.aspose.com/cells/net/use-custom-xml-parts-in-aspose-cells/

1 Like