Page 1 of 1

Adding Bullets in docx

PostPosted: Sat Jan 19, 2013 3:24 am
by Robb2012
Hello Everyone!
I am trying to add bullets into a docx file using NumberingDefinitionsPart class.
I am making use of Text, Paragraph, Run, Paragraph Properties(ppr), NumPr and Ilvl classes to add bullets into the docx.
But I am not able to add Abstract Numbering into the Numbering.xml part of the docx. As a result, every time I try to add new bullet, its numbering continues from the last bullet number of the previously added bullet. (Example if previously added bullet ends at number 3, then when added a new bullet, the numbering of this one starts at 4 and not at 1)
Please kindly suggests ways to overcome this issue.

Is this the right way to add bullets into a docx or is there a different approach that I need to follow?

Also, I would like to know how to add dots or circle or square as bullets?

Thanks, your help is highly appreciated!!
Regards.

Re: Adding Bullets in docx

PostPosted: Sat Jan 19, 2013 7:26 am
by jason
See the NumberingRestart sample.

Re: Adding Bullets in docx

PostPosted: Wed Jan 23, 2013 6:37 am
by Robb2012
Hey Jason,
Thanks for your reply.
The NumberingRestart sample adds the abstract numbering part manually by directly adding the xml string.
By directly adding the xml, the contents of the original numbering.xml of the docx are lost and getting replaced by the this new xml string.

Is there a way to add bullets into a docx by using some predefined functions of docx4j (and not by adding the xml string manually) and also in the process preserve the already present bullets in the docx?

Also, how to add bullets in the form of dots or squares and not as numbers?

Thanks, really appreciate your help.

Regards.