w:sdt
) element that preserves state through import/export.
OOXML Structure
Use Case
- Contract management - Lock legal clauses, leave business terms editable
- Multi-team documents - Each team owns their section
- Form templates - Some parts fixed, some parts fillable
Options
Configure the extension behavior:HTML attributes for document sections
Attributes
Node attributes that can be set and retrieved:Unique section identifier
Section display label (becomes w:alias in Word)
Additional metadata stored in w:tag
Business type for filtering/logic (e.g., ‘legal’, ‘pricing’)
Lock state (maps to w:lock=“sdtContentLocked”)
Commands
createDocumentSection
Create a lockable content section
Example:
Section configuration
removeSectionAtSelection
Remove section wrapper at cursor, preserving its content
Content stays in document, only section wrapper is removed
removeSectionById
Delete section and all its content
Example:
Section to delete
lockSectionById
Lock section against edits
Example:
Section to lock
updateSectionById
Modify section attributes or content
Example:
Changes to apply