【发布时间】:2020-06-03 18:01:19
【问题描述】:
我正在尝试借助 python-docx (https://github.com/mikemaccana/python-docx) 自动创建 .docx 文件 (WordML)。我当前的脚本使用以下循环手动创建 ToC:
for chapter in myChapters:
body.append(paragraph(chapter.text, style='ListNumber'))
有谁知道使用“内置单词”ToC 功能的方法,该功能会自动添加索引并创建各个章节的段落链接?
非常感谢!
【问题讨论】:
标签: python docx wordml python-docx