I have two documents that I try to merge partially.
I take some parts from document A that are inside a RTF content control and copy all child elements of the
foreach (var srcChildElement in sourceDocumentSdtContentBlockNode.ChildElements)
Well, I did manage to solve this. As already mentioned the Numbering information is stored in a separate part (or file inside the document zip): https://msdn.microsoft.com/en-us/library/office/ee922775(v=office.14).aspx
NumberingDefinitions (in NumberingPart) of the source I copied the necessary (where there is a
numPr inside a paragraph). To the target file by lookup up the
numId of the
I cloned the
num element and also the corresponding
abstractNum element to the target. Doing this I also replaced the IDs (incremented all by 1 using the existing element IDs in the target) like
nsid (hex value) to make sure there won't be any conflicts.
Was a bit work but very doable.