I'm tying to get the font color and text highlight of a paragraph

I have this line of code.

paragraphs = doc.get_child_nodes(aw.NodeType.PARAGRAPH, True)
for paragraph in paragraphs :
    paragraph = paragraph.as_paragraph()
    print(paragraph.get_text().strip())
    print("color",paragraph.paragraph_format.style.font.color)

Returns only zeros

@Mark030 Text formatting in MS Word documents is applied to run nodes not to paragraphs:

doc = aw.Document("C:\\Temp\\in.docx")
runs = doc.get_child_nodes(aw.NodeType.RUN, True)
for n in runs :
    r = n.as_run()
    print(r.text)
    print("color", r.font.color)
1 Like