I am using Open XML and a telerik control (RadRichTextBox) together to achieve my desired results.
Essentially my process is this:
Take content user enters into RadRichTextBox and insert it into a template word document, save it as a new document so that template can be reused.
This whole process is working great with a single exception.
When I have a bulleted list in telerik RadRichTextBox, the XML that I get from that is this:
<w:body xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:p>
<w:pPr>
<w:numPr>
<w:ilvl w:val="0" />
<w:numId w:val="2" />
</w:numPr>
<w:rPr />
</w:pPr>
<w:r>
<w:rPr />
<w:t xml:space="preserve">Test 1 </w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:numPr>
<w:ilvl w:val="1" />
<w:numId w:val="2" />
</w:numPr>
<w:rPr />
<w:ind w:right="0" />
</w:pPr>
<w:r>
<w:rPr />
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:numPr>
<w:ilvl w:val="0" />
<w:numId w:val="2" />
</w:numPr>
<w:rPr />
<w:ind w:right="0" />
</w:pPr>
<w:r>
<w:rPr />
<w:t xml:space="preserve">Test 2</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:numPr>
<w:ilvl w:val="0" />
<w:numId w:val="2" />
</w:numPr>
<w:rPr />
<w:ind w:right="0" />
</w:pPr>
<w:r>
<w:rPr />
<w:t xml:space="preserve">Test 3</w:t>
</w:r>
</w:p>
<w:sectPr>
<w:type w:val="nextPage" />
<w:pgSz w:w="12240" w:h="15840" />
<w:pgMar w:top="1425" w:right="1425" w:bottom="1425" w:left="1425" />
</w:sectPr>
</w:body>
When I insert that into my WordProcessingDocument my output looks like this:
When I change w:numId w:val=”1″ in the xml above and insert that it works perfectly fine.
I am assuming based on my research that my NumberingDefinitionsPart is not the same for a WordProcessingDocument and the output from my source which is a telerik RadRichTextbox.
For the output document this is the numberingDefinitions.
NumId: 1, AbstractNumId: 2, NumberingFormat: bullet
NumId: 2, AbstractNumId: 0, NumberingFormat: decimal
NumId: 3, AbstractNumId: 1, NumberingFormat: decimal
How can I modify the NumberingDefinitionsPart for my generated document?
2