Restart numbering of an ordered list in document.
See original GitHub issueWe can easily add ordered list with document.add_paragraph(style='ListNumber') code. But how can we restart its numbering?
Issue Analytics
- State:
- Created 10 years ago
- Reactions:4
- Comments:35 (3 by maintainers)
Top Results From Across the Web
Methods for restarting list numbering - Word MVP site
The most reliable way of creating numbered paragraphs is to use paragraph styles to apply the numbering. This makes all paragraphs with the...
Read more >How to create a list with restarting and continuing numbering
Restart numbering from 1 · Right-click the selected number and choose Restart at 1 in the popup menu: Restart at 1 in the...
Read more >How to Restart Numbering in Numbered List Word - YouTube
https://www.youtube.com/channel/UCmV5uZQcAXUW7s4j7rM0POg?sub_confirmation=1How to Restart Numbering in Numbered List Word.
Read more >Restarting a Numbered List Easily - Word Ribbon Tips
The field braces, remember, are inserted in your document by pressing Ctrl+F9. The first field code inserts a sequence number, started at 1....
Read more >Two Ways to Restart Numbered Lists in TX Text Control
Create an new style, name it Restart and select the preferred numbering. Since you want to restart the list, choose Restart numbering this...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

So I’ve made a thing that searches the existing abstract numbering schemes for the style of the current paragraph, and sets a reasonable abstract style based on that if possible:
This is in no way comprehensive or particularly robust, but it works pretty well for what I am trying to do.
@downtown12 I don’t have time to develop step-by-step instructions for you, but if you’re looking for the right direction to start looking for yourself, these might be helpful:
document.part.numbering_partNumberingPartobject provides access to a sequence ofNumberingDefinitionobjects:numbering_part.numbering_definitionsNumberingDefinitionsclass looks like where API support ends at the moment. You can get thew:numberingelement from it though, which is the parent of all the numbering definitions:numbering_definitions._numbering. From there you’ll need to work with lxml calls to get it’s children using XPath and so on.