I see a page(https://forum.aspose.com/t/118695) today.I want to know how to get the ListFormat.ListLevel.NumberFormat now,for example,“一、二、”“1.”、“2.”, and so on. Please tell me. Thank you.
Thanks for your inquiry. I suppose, you would like to get list item number. Am I right? 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 the 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.
Hi.Thank you for your reply.
I want to get a paragraph that it is ListItem and it contains a chinese character of “一、” now. I don’t know to how to get.
Thank you for additional information. Could you please attach sample document here? I will check it and provide you more information.
For example.I want to judge this docment whether it contains a chinese character of “一、”. If it contains, return true.
Thank you for additional information. This is what I told you in my first answer. “一、” character is number of list item. These numbers are not stored in the document; they are calculated on the fly.
I think you can just check ListLevel.NumberStyle. For paragraphs with Chinese numbers, it should be KanjiDigit.
Document doc = new Document(@"Test001\demo.doc"); Paragraph par = doc.FirstSection.Body.FirstParagraph; Console.WriteLine(par.ListFormat.ListLevel.NumberStyle);
Hope this helps.