Add read/write support for content controls (structured document tags / SDT). Upstream python-openxml#155 (15 comments), python-openxml#224 (15 comments).
API Design
Read:
- document.content_controls — iterate all SDTs in the document body
- paragraph.content_controls — SDTs within a paragraph
- ContentControl: .tag, .title, .type (plainText, richText, checkbox, comboBox, dropDown, date, picture)
- ContentControl.text — get/set the current value
- ContentControl.checked — for checkbox type
Write:
- paragraph.add_content_control(type, tag, title) — add an inline SDT
- body.add_content_control(type, tag, title) — add a block-level SDT
XML
- Block-level: w:sdt > w:sdtPr (properties) + w:sdtContent (content paragraphs)
- Inline: w:sdt within w:p > w:sdtPr + w:sdtContent (runs)
- w:sdtPr children: w:tag, w:alias (title), w:lock, w14:checkbox, w:comboBox, w:dropDownList, w:date
Add read/write support for content controls (structured document tags / SDT). Upstream python-openxml#155 (15 comments), python-openxml#224 (15 comments).
API Design
Read:
Write:
XML
Upstream issues: python-openxml#155, python-openxml#224