public void ApplyExistingListToParagraphs()
{
Document doc = new Document();
doc.Lists.Add(ListTemplate.NumberDefault);
//ExStart
//ExFor:Paragraph.ListFormat
//ExFor:ListFormat.List
//ExFor:ListFormat.ListLevelNumber
//ExFor:ListCollection.Item(Int32)
//ExSummary: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;
}
//ExEnd
}