标题中的Python自动编号为文本[docx文件] [英] Python auto-numbering in headings to text [docx files]

查看:90
本文介绍了标题中的Python自动编号为文本[docx文件]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to find a way to convert headings' auto-numbering to text

在MS Word的VBA中,它只是:

In MS Word's VBA it is just:

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

但是Python 3.x呢?

but how about Python 3.x?

推荐答案

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

Python-docx has the styles attribute. Documentation and examples of use here: http://python-docx.readthedocs.io/en/latest/user/styles-using.html

这篇关于标题中的Python自动编号为文本[docx文件]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆