paper-docxAPI referencecontrols
Control
paper-docx 0.2.0 API reference
Live proxy for one content control.
Control(sdt: '_Element', story: str, document: 'Document')Attributes
alias
attributealiasOptional[str]control_type
attributecontrol_typestris_data_bound
attributeis_data_boundboolshowing_placeholder
attributeshowing_placeholderbooltag
attributetagOptional[str]value
attributevalue'Union[str, bool]'The control's current value (bool for checkboxes, text otherwise).
Functions
info
funcinfo() -> ControlInfoReturns
docx.controls.ControlInfoset_value
funcset_value(value: 'Union[str, bool, dt.date, dt.datetime]') -> NoneSet the control's value, validating fully before mutating anything.
Text and rich-text controls take a string, checkboxes a bool, dropdowns a value from
their w:listItem choices, dates an ISO date. Refuses a protected document, a stale or
foreign control, a locked or data-bound surface, a picture, group or building-block
control, a dropdown value outside its choices, and an unsupported date format.
paramvalue'Union[str, bool, dt.date, dt.datetime]'Returns
None