Skip to content

Apply latent style to paragraph #453

@lvovil

Description

@lvovil

Hi,

My issue is that I have List Bullet 2 style in list of latent styles. I'm trying to apply the style to the paragraph but have following errors:

>>> p = doc.add_paragraph()
>>> p.style = 'List Bullet 2'
KeyError: "no style with name 'List Bullet 2'"
>>> doc.styles.latent_styles.default_to_hidden
False
>>> doc.styles.latent_styles.default_to_locked
False
>>> s = doc.styles.latent_styles['List Bullet 2']
>>> s.priority
1
>>> s.hidden
False
>>> s.quick_style
True
>>> p.style = s
TypeError: unhashable type: '_LatentStyle'

Could you help me please with the issue?

Thanks

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