Hi Team,
I am trying to find and iterate lists in an word documents using aspose words python library.
Current approach :
I have tried iterating all paragraphs and filtering list items using is_list_item method.
Further I try to extract list level using list_level_number, but it is failing in few cases(attached document).
import aspose.words as aw
license = aw.License()
license.set_license("license_path")
doc = aw.Document("test.docx")
for para in doc.get_child_nodes(aw.NodeType.PARAGRAPH, True):
if para.as_paragraph().is_list_item:
list_level = para.as_paragraph().list_format.list_level_number
Is there a preferred/better way of doing this ?
Can you please help me solve this problem. I have attached a test document.
test.docx (11.9 KB)