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

Free Support Forum - aspose.com

How to determine if paragraph list is numbered- bulleted or multi level

How do I determine if a ms word paragraph list is numbers, bullets, or multi level. Then once I determine which list, how do I grab all of the formatting of that list. Can someone send me a code example.
thanks

Hi
Thanks for your request. Please try using the following code:

NodeCollection<Paragraph> docSections = doc.getChildNodes(NodeType.PARAGRAPH, true);
for (Paragraph paragraph : docSections)
{
    if (paragraph.isListItem())
    {
        ListFormat listFormatLevel1 = paragraph.getListFormat();
        System.out.println("Paragraph : " + paragraph.getText() + "level : " + listFormatLevel1.getListLevelNumber() + "\n\r");
    }
}

Best regards,

Andrew,
The listFormatLevel tells me the level, but how can I find out if its a bullet or numbered list, meaning how can I find out which ListTemplate it is? Can you show me the code for this.

Hi
Thanks for your inquiry. I think, NumberStyle is just what you are looking for:
https://reference.aspose.com/words/java/com.aspose.words/listlevel#NumberStyle
Hope this helps.
Best regards,