Closed
Description
https://python-docx.readthedocs.io/en/latest/user/styles-using.html#add-or-delete-a-style
issue: I have tried following python demo code, but I can't see them work well in office word2016.(No Error Raised)
'''
from docx import Document
document = Document()
styles = document.stylesstyles['Heading 1'].next_paragraph_style = styles['Body Text']
'''
my demo code
styles = document.styles
styles['Heading 1'].next_paragraph_style = styles['Colorful Grid']
document.add_paragraph("Working with Styles", style='Heading 1')
p7 = document.add_paragraph('next_paragraph_style' * 20)
ipython shell code
In [14]: styles['Heading 2'].next_paragraph_style
Out[14]: _ParagraphStyle('Normal') id: 2512638940664
Metadata
Metadata
Assignees
Labels
No labels