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

Free Support Forum - aspose.com

How to differentiate between ordered and unordered bullet list?

Hi Team,

I need to differentiate between ordered and unordered list ,Below is the code I am using but insane.Can you help me for same.

if (para.isListItem())
{
    com.aspose.words.List list0 = para.getListFormat().getList();
    Listless level0 = list0.getListLevels().get(para.getListFormat().getListLevelNumber());
    String style = level0.getNumberFormat();
    System.out.println("Number style " + style);
}

Appreciate for very soon reply.

Thanks
Sonam

Hi Sonam,

Thanks for your inquiry. ListTemplate specifies one of the predefined list formats available in Microsoft Word. Unfortunately, Aspose.Words does not support the
requested feature at the moment. However, we had already logged a feature request as WORDSNET-7562 in
our issue tracking system to determine the ListTemplate e.g BulletDisk,
BulletCircle, BulletSquare etc. You will be notified via this forum
thread once this feature is available.We apologize for your inconvenience.

As a workaround of this issue, please get the label of each paragraph in a list as a value or a string to determine either list is ordered list or not. Hope this helps you.

Document doc = new Document(MyDir + "in.docx");
doc.updateListLabels();
for (Paragraph para : (Iterable)doc.getChildNodes(NodeType.PARAGRAPH, true))
{
    if (para.isListItem())
    {
        ListLabel label = para.getListLabel();
        System.out.println(label.getLabelString());
        System.out.println(label.getLabelValue());
    }
}