OfficeIMO

API Reference

Class

WordListNumbering

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word

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 requiredposition: 0
Numbering definition to wrap.

Methods

AddLevel 2 overloads
public Void AddLevel(Level level) #
Returns: Void

Adds the level using custom simplified list number.

Parameters

wordListLevel OfficeIMO.Word.WordListLevel requiredposition: 0
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 required
The level.
public static WordListNumbering CreateNumberingDefinition(WordDocument document) #
Returns: WordListNumbering

Creates a new numbering definition within the specified document.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
The parent document.

Returns

The created WordListNumbering.

public static WordListNumbering GetNumberingDefinition(WordDocument document, Int32 abstractNumberId) #
Returns: WordListNumbering

Retrieves a numbering definition from the document by its identifier.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
The parent document.
abstractNumberId System.Int32 requiredposition: 1
The abstract numbering identifier.

Returns

The WordListNumbering if found; otherwise, null.

public Void RemoveAllLevels() #
Returns: Void

Removes 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 required
The word list level.

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.