Skip to main content
 首页 » 编程设计

文本标题中的 Python 自动编号 [docx 文件]

2025年01月19日11soundcode

我正在尝试找到一种将标题的自动编号转换为文本的方法

在 MS Word 的 VBA 中它只是:

Sub Test() 
ActiveDocument.Range.ListFormat.ConvertNumbersToText 
End Sub 

但是 Python 3.x 呢?

请您参考如下方法:

Python-docx 具有 styles 属性。此处的文档和使用示例:http://python-docx.readthedocs.io/en/latest/user/styles-using.html