hi
i ues the code below:
ADoc.Paragraph p = n as ADoc.Paragraph;
p.ParagraphFormat.Style.ListFormat.ListLevelNumber;
but i found the return value will be less than the actual value, for example, a document like below:
1 chapter1 ------- ListLevelNumber:0
1.1 chapter1.1 ------- ListLevelNumber:1
1.1.1 chapter1.1.1 ------- ListLevelNumber:2
in my mind, i think the return value will be: 1, 2, 3
i don't know whether is i going to the wrong way?
can you show me a code snippet? thanks.
Hi Pyntia,
Thanks for your inquiry. The ListFormat.ListLevelNumber property can be used to get or set the list level number (0 to 8) for the paragraph. In Word documents, lists may consist of 1 or 9 levels, which are numbered 0 to 8. It has effect only when the List property is set to reference a valid list. Please see the following code which applies list formatting of an existing list to a collection of paragraphs.
Body body = doc.FirstSection.Body;
Aspose.Words.Lists.List list = doc.Lists[0];
foreach (Paragraph paragraph in body.Paragraphs)
{
paragraph.ListFormat.List = list;
paragraph.ListFormat.ListLevelNumber = 2;
}
Please let me know if I can be of any further assistance.
Best regards,
hi, Awais Hafeez
i got it,thank you very much.
hi, Awais Hafeez
thank you for your reply
i got it and your code is nice