Skip to main content
Version: 4.1 (2026 H2)

WordContent Snippet

A WordContent snippet is a reusable block of native Word content — text with formatting, tables, images, content controls, or any other element that can exist in a Word document. It is stored as part of a template and injected into a document at generation time.

WordContent snippets are intended for layouters. They are stored in the Design (template) category and are not visible to end users.

When to Use WordContent Snippets

Use a WordContent snippet when you need to:

  • Reuse a complex formatted block (e.g. a table, address block, or legal clause) across multiple templates.
  • Dynamically insert different content blocks depending on user input or profile data.
  • Keep headers, footers, or body sections consistent across content templates that share the same layout.

For simple formatted text (bold, italic, line breaks), use a FormattedText snippet instead — it is lighter and HTML-based.

Creating a WordContent Snippet

WordContent snippets are created and managed via the Snippet sidebar (task pane) in Word — not via a tab in the template editor.

  1. In primedocs Desktop, open the template in which the snippet should be stored.
  2. Open the Snippet sidebar.
  3. Create a new snippet of type Word Content.
  4. Give the snippet a name and edit its content in Word.
  5. Save the snippet.

Using a WordContent Snippet in a Template

A WordContent snippet is embedded via the Fields document function: a Field of type WordContent retrieves the snippet through the snippets API. The result is inserted wherever the Field is placed in the template.

$.snippets.getWordContent("SnippetName")

This also allows the snippet to be selected conditionally based on form input or profile data:

const snippetName = $("Forms.Department") === "Legal" ? "LegalDisclaimer" : "StandardDisclaimer";
$.snippets.getWordContent(snippetName);
note

primedocs.SnippetBlockPlaceholder=… and the other snippet placeholders are not a template-side reference to a snippet, but placeholders inside a snippet. They are filled when the snippet is retrieved via getWordContent(...) — see below.

Filling placeholders in the snippet

If the snippet contains placeholders, they are filled via a mapping object passed as the second argument. The key is the placeholder name, the value is the content to insert (a text, a field reference via $.getReference(...), or another snippet/field value):

$.snippets.getWordContent("SnippetName", {
"Profile.User.LastName": $.getReference("Profile.User.LastName"),
"Salutation": "Dear Sir or Madam"
});

For Profile, Forms and Data fields, $.createAutoMapping() builds the mapping automatically. For details on the placeholder types and the snippets API, see Snippets.

Foreign content controls

If inserted Word content contains content controls from another document (e.g. foreign primedocs.Field tags from a subset document), this no longer blocks generation: content controls not created by primedocs are removed during cleanup. Foreign table-row content controls are preserved, so table structure and locked content remain unchanged.

Permissions

WordContent snippets are stored in the Design category. Only Template Admins and Sys Admins can create or edit them. See Snippet Permissions for details.