Microsoft Word (DOCX)
Use this page when you want to design the document in Microsoft Word and generate a true .docx output from Salesforce data.
A DOCX template is built in Word, then uploaded to S-Docs for generation.
Use it when Word layout tools matter more than HTML or CSS control.
When DOCX is the right fit
Use DOCX templates when you need:
Microsoft Word layout and styling tools
a generated
.docxfilemerge fields inside a Word document
conditional sections in Word
related list tables inside Word tables
named queries in Microsoft template syntax
reusable DOCX components
DOCX is a strong fit for contracts, letters, forms, packets, and customer documents that users may keep editing in Word after generation.
How DOCX templates work
The document design lives in Word.
The dynamic data comes from S-Docs syntax placed inside the Word file.
DOCX templates use bracketed syntax around S-Docs blocks and merge fields.
Build and upload a DOCX template
Core DOCX patterns
Merge fields
Wrap merge fields in square brackets.
Conditional logic
Use bracketed RENDER tags.
Component templates
Use a DOCX Component template type here.
Named queries
Wrap both the query block and the output fields in square brackets.
Related list tables
DOCX related lists render inside Word tables.
Use a table with:
a header row
an odd row
an even row
Then wrap the table with DOCX table tags.
Supported features
DOCX templates support these common S-Docs capabilities:
merge fields
conditional logic
named queries
related list tables
component templates
embedded images
Word-native formatting and layout
Important constraints
Keep these DOCX rules in mind:
Use square brackets around DOCX merge fields and markup blocks.
Use Word tables for repeating table output.
Re-upload the file after updating it in Word.
Live Edit is not supported.
Next reads by goal
Need merge field syntax? Read Merge Fields With Microsoft Templates.
Need DOCX table setup? Read How to: Create a Table In Microsoft Templates.
Need DOCX conditional syntax? Read Quick Setup: Conditional Logic With Microsoft Templates.
Need named query patterns? Read How To: Advanced Data Retrieval with Named Queries.
Need DOCX components? Read Component (DOCX).
Need to fix Word paste styling? Read Copy from Word: WindowText.
Need to fix proofreading markup errors? Read DOCX Generation Failure: SpellStart.
Need checkbox output in DOCX? Read checkboxes with docx.
Need embedded image troubleshooting? Read Generating DOCX DOC DOC New Documents with Embedded Images.
Last updated
Was this helpful?

