For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Pick DOCX when you want Word-native formatting, editable Word output, and bracket-based S-Docs syntax.

Pick PDF Templates when you want the layout built directly in the template body.

When DOCX is the right fit

Use DOCX templates when you need:

  • Microsoft Word layout and styling tools

  • a generated .docx file

  • merge 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

1

Create the template record

Create a new S-Docs template.

Set the format to DOCX.

2

Build the document in Microsoft Word

Create the layout in Word just as you want it to appear.

Use normal Word tools for fonts, spacing, tables, headers, and page layout.

3

Add S-Docs fields and logic

Insert merge fields with DOCX syntax.

Use square brackets around fields, query blocks, and render blocks.

4

Upload the .docx file

Open the template in Template Editor.

Upload the Word file so S-Docs can use it for generation.

5

Generate and test

Test with real record data.

Verify merge fields, table output, images, and conditional sections before rollout.

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.

DOCX related lists render inside Word tables.

Use a table with:

  1. a header row

  2. an odd row

  3. 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

Last updated

Was this helpful?