For the purpose of better structuring data in a small team using Office-2016, I've discovered and explored Custom XML Parts
, see docs.microsoft.com.
In Word, I was able to create Content Controls
mapped to an XML file and next to get the XML content using OpenXML SDK
(aka DocumentFormat.OpenXml
) project WordprocessingDocument.MainDocumentPart.CustomXmlParts.
I can do kind of the same in Excel for aggregating ("Importing") all these XML documents. I am NOW aware of the Export limitations in Excel that restrict the export of the XML (no Lists of list, somehow XML should be structured in a flat table-like way). I thought I can circumvent the Export limitations using the Word approach, namely a Custom XML that I can later get using OpenXml SDK. But Excel and Word don't work the same way: in Excel, the mapped XML doesn't appear to be as CustomXML and users cannot populate it AFAIK. Is this approach doable?
In Excel, I can add and get a Custom XML as I did in Word thanks to the DocumentFormat.OpenXml
API, inspired from Open XML SDK 2.0.
How can I populate this Custom XML part with the mapped content so that I can save the aggregation and possible modifications as an XML file that can be later reimported? The overall workflow is map an XML Schema in Excel, aggregate XML files extracted from Word in Excel, modify if needed in Excel, merge mapped content with Custom XML Part, extract the result as XML. Maybe abandoning is the best solution!
Prefered approach if any is in .NET/OpenXML SDK but any would help.