Use Case
- Form templates - Create fillable documents with inline text fields and block content areas
- Contract generation - Dynamic clauses and terms that map to Word content controls
- Document automation - Programmatically update specific sections while preserving structure
Quick Start
Options
Configure the extension behavior:CSS class for the block
HTML attributes for structured content blocks
Attributes
Node attributes that can be set and retrieved:Unique identifier for the structured content block
The
id attribute must be a numeric string for valid DOCX output (per
ECMA-376
§17.5.2.18).
Use Date.now().toString() or sequential integers instead of UUIDs.Content control tag (e.g., ‘block_table_sdt’)
Display name for the block
Commands
insertStructuredContentInline
Inserts a structured content inline at selection.
Parameters:
insertStructuredContentBlock
Inserts a structured content block at selection.
Parameters:
updateStructuredContentById
Updates a single structured content field by its unique ID.
IDs are unique identifiers, so this will update at most one field.
If the updated node does not match the schema, it will not be updated.
Parameters:
Unique identifier of the field
deleteStructuredContent
Removes a structured content.
Parameters:
deleteStructuredContentById
Removes a structured content by ID.
Parameters:
deleteStructuredContentAtSelection
Removes a structured content at cursor, preserving its content.
appendRowsToStructuredContentTable
Append multiple rows to the end of a table inside a structured content block.
Each inner array represents the cell values for one new row.
Example:
Append configuration
Helpers
getStructuredContentBlockTags
Get all block-level structured content tags in the document
Example:
getStructuredContentInlineTags
Get all inline structured content tags in the document
Example:
getStructuredContentTablesById
Find all tables inside a structured content block by ID
Example:
Structured content block ID
getStructuredContentTags
Get all structured content tags (inline and block) in the document
Example:
getStructuredContentTagsById
Get structured content tag(s) by ID
Example:
Single ID or array of IDs to find

