'Start heading 1 of existing docx in new page with python-docx
In an existing word document, I want to start all the headings 1 beginning from the new page using #python-docx. I have tried the following code as below:
from docx import *
document=Document("document location")
sections=document.sections
for section in sections:
document.add_page_break()
but the code is not working and it is adding additional page breaker where the existing heading 1 starting with new page. Please suggest any solution
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
