doc = Document(r'D:\xxxx\xxxx\xxx.docx')
#读取word中所有内容
for p in doc.paragraphs
print(p,p.text)
#读取指定段落中的所有run(文字块)
for run in doc.paragraphs[1].runs:
print(run,run.text)
#读取word中所有表格内容
for 表格 in doc.tables:
print(表格)
for 行 in 表格.rows:
for 单元格 in 行.cells:
print(单元格.text)