Problem with getting ListID

Hi,
I downloaded the sample examples of Aspose.Words from Aspose website to work with Paragraph Lists. In the downloaded files one of the file is “ExLists.cs” in “Exapmples” folders. This “ExLists.cs” file contains one of the below method:

[Test]
public void DetectBulletedParagraphs()
{
    Document doc = new Document();
    // ExStart
    // ExFor:Paragraph.ListFormat
    // ExFor:ListFormat.IsListItem
    // ExFor:List.ListId
    // ExSummary:Finds and outputs all paragraphs in a document that are bulleted or numbered.
    NodeCollection paras = doc.GetChildNodes(NodeType.Paragraph, true);
    foreach(Paragraph para in paras)
    {
        if (para.ListFormat.IsListItem)
        {
            Console.WriteLine(string.Format(" A paragraph belongs to list {0}", para.ListFormat.List.ListId));
            Console.WriteLine(para.GetText());
        }
    }
    // ExEnd
}

I executed this code on one of the document which contains List numbers, but the property para.ListFormat.List.ListId is always showing number One(1) for all the lists. I attached my test document.
Could i know how to get correct ListItem number??
Thanks,

Hi

Thanks for your inquiry. ListId is not list item number, this is identifier of the list, the list item belongs to.
https://reference.aspose.com/words/net/aspose.words.lists/list/listid/
Unfortunately, there is no way to get list item numbers using Aspose.Words. These numbers are not stored in the document. MS Word calculates list numbers on fly during opening document. However, you can try to create your own method for calculating list numbers.
I created sample code for another customer to achieve similar task. Please see the following link to learn more.
https://forum.aspose.com/t/106128
Best regards.