API Reference
WordListNumbering
Provides helper methods to manage numbering definitions for lists within a document. Levels can be added or removed and the numbering updated to match the Open XML specification.
Inheritance
- Object
- WordListNumbering
Constructors
public WordListNumbering(AbstractNum abstractNum) #Initializes a new instance based on the provided AbstractNum definition.
Parameters
- abstractNum DocumentFormat.OpenXml.Wordprocessing.AbstractNum
- Numbering definition to wrap.
Methods
public Void AddLevel(Level level) #VoidAdds the level using custom simplified list number.
Parameters
- wordListLevel OfficeIMO.Word.WordListLevel
- The word list level.
AddLevel(DocumentFormat.OpenXml.Wordprocessing.Level level) #Adds the level allowing for customization using OpenXML directly.
Parameters
- level DocumentFormat.OpenXml.Wordprocessing.Level
- The level.
public static WordListNumbering CreateNumberingDefinition(WordDocument document) #WordListNumberingCreates a new numbering definition within the specified document.
Parameters
- document OfficeIMO.Word.WordDocument
- The parent document.
Returns
The created WordListNumbering.
public static WordListNumbering GetNumberingDefinition(WordDocument document, Int32 abstractNumberId) #WordListNumberingRetrieves a numbering definition from the document by its identifier.
Parameters
- document OfficeIMO.Word.WordDocument
- The parent document.
- abstractNumberId System.Int32
- The abstract numbering identifier.
Returns
The WordListNumbering if found; otherwise, null.
public Void RemoveAllLevels() #VoidRemoves all levels to reset the numbering and start from scratch.
UpdateLevelText(OfficeIMO.Word.WordListLevel wordListLevel) #Updates the level text. The level text is the text that is displayed for the level in the list. The text can contain a placeholder %CurrentLevel which will be replaced with the level index + 1.
Parameters
- wordListLevel OfficeIMO.Word.WordListLevel
- The word list level.
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public List<WordListLevel> Levels { get; } #Gets all numbering levels defined in the underlying AbstractNum element.
public Int32 AbstractNumberId { get; } #Gets the abstract numbering identifier.
GetNextLevelIndex #Gets the index of next level to be able to set it
Value
The index of the get next level.
Fields
_abstractNum #The abstract number, which is the parent of the levels.