Skip to content

customize numbering style #938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
joannahsu11 opened this issue Apr 28, 2021 · 1 comment
Closed

customize numbering style #938

joannahsu11 opened this issue Apr 28, 2021 · 1 comment

Comments

@joannahsu11
Copy link

I'm trying to use python docx to customize a numbering style when adding a paragraph in a word file.

For example, instead of just adding '1. ' in the beginning of a paragraph, I wanna do 'class #1. '

so I want my paragraph to be like: class #1. xxxx
instead of: 1. xxxx

Is it possible? How to do it?
Any advice would be greatly appreciated. Thanks

@joannahsu11 joannahsu11 changed the title numbering style customize numbering style Apr 28, 2021
@scanny
Copy link
Contributor

scanny commented Apr 28, 2021

The short answer is "not easily". There is no API support for this in python-docx. This turns out to be a fairly complex problem. If you search Google on python-docx numbering style you'll find some odds and ends of folks that have gotten something working to various degrees.

For future reference, please post support questions on Stack Overflow using the python-docx tag: https://stackoverflow.com/questions/tagged/python-docx. Support questions generally get more attention over there and are more accessible for folks looking to find things on search. The issues list here is for feature requests and suspected bugs.

@scanny scanny closed this as completed Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants