Skip to content

styles['Heading 1'].next_paragraph_style don't work well #299

Closed
@waterdr0p

Description

@waterdr0p

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.styles

styles['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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions