Quantcast
Viewing all articles
Browse latest Browse all 7205

How to create a multilevel numbered list in code


This example illustrates how to create a numbered list in code.

Add a new AbstractNumberingList instance to the Document.AbstractNumberingLists collection.

Specify a NumberingListBase.NumberingType property, so that it is equal to the NumberingType.Multilevel value.

For each list level, specify the paragraph characteristics using the ListLevel.ParagraphPropertiesListLevel.ParagraphProperties property. Set the left indentation so that each level has a different offset from the left. Specify a hanging first line and set the first line indent value to provide enough space for a number that precedes the text. Set the starting number value. Specify a format used to display a number via the NumberingFormat property.
Use the Add method of the collection of lists in the document (accessible via the Document.NumberingLists property) to add a list definition to the document. The parameter is the index of an abstract numbering list created previously. The Add method creates a pattern that can be applied to a paragraph so that the paragraph looks like a list item.

To include a paragraph in a list, set the ListIndex property of a paragraph to the index of a list in the document and specify the ListLevel property.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>