How to create a bulleted list in Apache POI XWPF Document?

后端 未结 5 509
鱼传尺愫
鱼传尺愫 2021-01-14 09:15

I want to create a bulleted/numbered list in a docx word document with Java. I am using the Apache POI 3.10 library. If I understand correctly, the steps would be like this:

5条回答
  •  误落风尘
    2021-01-14 09:36

    Open the document Get the XWPFNumbering object from the document. Get the list of XWPFParagraphs from the document. Step through the list of paragraphs and as you get each one try to get the number ID from it. If this returns null then the paragraph is not in a list. If it does not return null, you can use the BigInteger to retrieve, from the XWPFNumbering object, details of the numbering/bulleting scheme applied to the paragraph.

    I referred from this website

提交回复
热议问题