wordml

Python: Create a "Table Of Contents" with python-docx/lxml

Python: Create a "Table Of Contents" with python-docx/lxml Question: I’m trying to automate the creation of .docx files (WordML) with the help of python-docx (https://github.com/mikemaccana/python-docx). My current script creates the ToC manually with following loop: for chapter in myChapters: body.append(paragraph(chapter.text, style=’ListNumber’)) Does anyone know of a way to use the “word built-in” ToC-function, which adds …

Total answers: 4