NumberList — Aspose.Note FOSS for Python API Reference
Class: NumberList
Package: aspose.note
Import: from aspose.note import NumberList
NumberList holds the list-numbering metadata attached to an OutlineElement. When OutlineElement.NumberList is not None, the element is part of an ordered or unordered list. The properties reflect raw values parsed from the MS-ONE binary format and are read-only; they are not user-settable in v26.3.1.
Properties
All properties are Read-only.
| Property | Type | Default | Description |
|---|---|---|---|
Format | str | None | None | MS-ONE number format string for this list item (e.g. "%1)", "•"). None when absent. |
NumberFormat | str | None | None | Alternate number format string. |
Font | str | None | None | Font family name for the list prefix. |
FontSize | float | None | None | Font size in points for the list prefix. |
FontColor | int | None | None | Font color as ARGB integer for the list prefix. |
IsBold | bool | False | Bold weight for the list prefix. |
IsItalic | bool | False | Italic style for the list prefix. |
Restart | int | None | None | Explicit restart number. When set, the list restarts counting from this value. None means the list continues from the previous item. |
Notes
- Read-only data: All properties are parsed from the binary file. There is no API to modify numbering in v26.3.1.
- Format strings: The
Formatstring follows the raw MS-ONE numbering format, not a human-readable pattern. Common values include decimal format strings ("%1.","%1)") for numbered lists and bullet characters ("•","–") for bulleted lists. - Presence check: Always check
OutlineElement.NumberList is not Nonebefore accessing this object.
Usage Example
Detect list items and inspect format
from aspose.note import Document, OutlineElement
doc = Document("MyNotes.one")
for oe in doc.GetChildNodes(OutlineElement):
nl = oe.NumberList
if nl is None:
continue # not a list item
restart_info = f" restart={nl.Restart}" if nl.Restart is not None else ""
print(f"format={nl.Format!r}{restart_info}")Collect all list items with their text
from aspose.note import Document, OutlineElement, RichText
doc = Document("MyNotes.one")
for oe in doc.GetChildNodes(OutlineElement):
nl = oe.NumberList
if nl is not None:
texts = [rt.Text for rt in oe.GetChildNodes(RichText) if rt.Text]
print(f"[{nl.Format!r}] {' | '.join(texts)}")None-Safety
Format, NumberFormat, Font, FontSize, FontColor, and Restart may be None. IsBold and IsItalic are always bool. OutlineElement.NumberList itself may be None — check before accessing any property.
See Also
- OutlineElement: the element that carries a
NumberList - Developer Guide