is_restart_at_each_section property
List.is_restart_at_each_section property
Specifies whether list should be restarted at each section.
Default value is False
.
@property
def is_restart_at_each_section(self) -> bool:
...
@is_restart_at_each_section.setter
def is_restart_at_each_section(self, value: bool):
...
Remarks
This option is supported only in RTF, DOC and DOCX document formats.
This option will be written to DOCX only if OoxmlCompliance is higher then OoxmlCompliance.ECMA376_2006.
Examples
Shows how to configure a list to restart numbering at each section.
doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
doc.lists.add(list_template=aw.lists.ListTemplate.NUMBER_DEFAULT)
list = doc.lists[0]
list.is_restart_at_each_section = restart_list_at_each_section
# The "IsRestartAtEachSection" property will only be applicable when
# the document's OOXML compliance level is to a standard that is newer than "OoxmlComplianceCore.Ecma376".
options = aw.saving.OoxmlSaveOptions()
options.compliance = aw.saving.OoxmlCompliance.ISO29500_2008_TRANSITIONAL
builder.list_format.list = list
builder.writeln('List item 1')
builder.writeln('List item 2')
builder.insert_break(aw.BreakType.SECTION_BREAK_NEW_PAGE)
builder.writeln('List item 3')
builder.writeln('List item 4')
doc.save(file_name=ARTIFACTS_DIR + 'OoxmlSaveOptions.RestartingDocumentList.docx', save_options=options)
doc = aw.Document(file_name=ARTIFACTS_DIR + 'OoxmlSaveOptions.RestartingDocumentList.docx')
self.assertEqual(restart_list_at_each_section, doc.lists[0].is_restart_at_each_section)
See Also
- module aspose.words.lists
- class List