doc = aw.Document("C:\\Temp\\in.docx")
for s in doc.sections :
sect = s.as_section()
# loop though the direct children of the document body
for node in sect.body.get_child_nodes(aw.NodeType.ANY, False) :
# Check node type.
if node.node_type == aw.NodeType.PARAGRAPH :
para = node.as_paragraph()
if para.paragraph_format.outline_level in [0, 1, 2, 3, 4, 5]:
print("Level: " + str(para.paragraph_format.outline_level) + "\t" + para.to_string(aw.SaveFormat.TEXT))
if node.node_type == aw.NodeType.TABLE :
# here you can process the table.
print("table")