Is there a way to change the font of a specific number format For example.
3.1
3.1.1
3.#.#.#
@Mark030 You can use the following code to change formatting of list item labels:
doc = aw.Document("C:\\Temp\\in.docx")
# loop throug the list in the document and chnage formatting of certain levels.
for lst in doc.lists:
for lst_lvl in lst.list_levels:
if lst_lvl.number_format == "\x00." or lst_lvl.number_format == "\x00.\x01." or lst_lvl.number_format == "\x00.\x01.\x02.":
lst_lvl.font.color = pydraw.Color.red
doc.save("C:\\Temp\\\out.docx")
Is there a way to change the style of a list item. for example I want to change it to Heading 1
@Mark030 You can simply set style of the paragraph that is list item. For example see the following code:
doc = aw.Document("C:\\Temp\\in.docx")
for p in doc.get_child_nodes(aw.NodeType.PARAGRAPH, True) :
p = p.as_paragraph()
if p.is_list_item:
p.paragraph_format.style_identifier = aw.StyleIdentifier.HEADING1
doc.save("C:\\Temp\\out.docx")