We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Place the field before the list paragraph

Hi there,
Suppose given a list based paragraph in the word doc, we need to insert the field just before such a paragraph.

For instance -
<!–[if gte mso 9]>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>

  1. <span style=“font-size:8.0pt;font-family:“Times New Roman”,“serif”;
    mso-fareast-font-family:“Times New Roman”;mso-fareast-theme-font:minor-fareast;
    AR-SA”>We recorded 2013.

This would be represented in /word/document.xml as -

- <w:p w:rsidR="00BE74DC" w:rsidP="00BE74DC">
- <w:pPr>
<w:pStyle w:val="ListParagraph" />
- <w:numPr>
<w:ilvl w:val="0" />
<w:numId w:val="2" />
- <w:rPr>
<w:color w:val="FF0000" />
<w:sz w:val="16" />
<w:szCs w:val="16" />
- <w:r w:rsidRPr="00BE74DC">
- <w:rPr>
<w:color w:val="FF0000" />
<w:sz w:val="16" />
<w:szCs w:val="16" />
<w:t xml:space="preserve">We recorded 2013.</w:t>

We are in the assumption that the xml snippet -
- <w:numPr>
<w:ilvl w:val="0" />
<w:numId w:val="2" />

determines the list label (1., a. *. etc.).

We don't want to insert the field at the end of paragraph just before it, neither we want to create new paragraph before it.

So, we think DocumentBuilder needs to move just before

- <w:numPr>
<w:ilvl w:val="0" />
<w:numId w:val="2" />
and we need to insert the field just before it and within the paragraph.

Could you please help us for the same?

Hi Praneeth,

Thanks for your inquiry. Please attach the following resources here for testing.

  1. Input Word document which contains a list paragraph
  2. Expected Word document which shows the desired behavior. Please create this document using MS Word.

We will then provide you code to achieve the same expected output using Aspose.Words.

Best regards,