python-openxml / python-docx

Create and modify Word documents with Python
MIT License
4.49k stars 1.11k forks source link

Reading list numbers along with text #614

Open sidsunlife opened 5 years ago

sidsunlife commented 5 years ago

I am trying to read a word file which has following structure with ordered list

  1. Overview(heading 1)
  2. Required changes(heading 1) 2.1 General Changes (heading 2) 2.2 Functional Changes (heading 2)
  3. Review Section (heading 1) 3.1 General comments(heading1) 3.2 Functional comments(heading 2)

While reading the file, I am able to read the text of the file successfully but I also need to read the list numbers along with the text. I tried to search for it but could not find anything substantial.

How can i do it

brasky commented 5 years ago

There's a feature request open for this #471, I'm not sure if there's a very intuitive way to get the list number. I'm doing some experimentation to see what I can find.