Skip to content

WD_BUILTIN_STYLE gives no style with name #1439

Open
@cmhughes

Description

@cmhughes

Starting from the minimal code given at https://python-docx.readthedocs.io/en/stable/api/enum/WdBuiltinStyle.html

from docx import Document
from docx.enum.style import WD_STYLE

document = Document()
styles = document.styles
style = styles[WD_STYLE.BODY_TEXT]

gives the following error:

KeyError: "no style with name 'BODY_TEXT (-67)'"

I'm sure I'm doing something wrong, but if you know of a way I can fix this, I'd be very grateful. Thank you for your time!

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