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.

PropertyTypeDefaultDescription
Formatstr | NoneNoneMS-ONE number format string for this list item (e.g. "%1)", "•"). None when absent.
NumberFormatstr | NoneNoneAlternate number format string.
Fontstr | NoneNoneFont family name for the list prefix.
FontSizefloat | NoneNoneFont size in points for the list prefix.
FontColorint | NoneNoneFont color as ARGB integer for the list prefix.
IsBoldboolFalseBold weight for the list prefix.
IsItalicboolFalseItalic style for the list prefix.
Restartint | NoneNoneExplicit 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 Format string 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 None before 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