locked property

Style.locked property

Specifies whether this style is locked.

@property
def locked(self) -> bool:
    ...

@locked.setter
def locked(self, value: bool):
    ...

Examples

Shows how to lock style.

doc = aw.Document()
style_heading1 = doc.styles.get_by_style_identifier(aw.StyleIdentifier.HEADING1)
if not style_heading1.locked:
    style_heading1.locked = True
doc.save(file_name=ARTIFACTS_DIR + 'Styles.LockStyle.docx')

See Also