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.

Quick Check fields in a snippet​

A WordContent snippet may contain content controls tagged primedocs.Tracked. This allows a Quick Check block to be built once and reused across several templates. The tag must be exactly primedocs.Tracked. With an addition such as =value, the snippet cannot be saved. All types of content controls are allowed, including date and checkbox. A tracked content control must not be locked, otherwise it could not be filled in.

The placeholder text of a content control is preserved in the snippet and carried over into the generated document when the snippet is inserted. As long as a field still shows its placeholder text, the Quick Check counts it as not filled in.

Fill-in hints

Inside a snippet, only primedocs.HintText=[TEXT] is permitted. primedocs.HintField=[FieldId] is not allowed in snippets, so multilingual hint texts via a field do not work there.

Comments in a snippet​

Word comments anchored in the content of the snippet are kept when the snippet is saved, including replies and the «resolved» state. During document generation they appear in the generated document at the same position.

primedocs removes personal data on saving: every comment shows the neutral value «Author» as its author, initials and date are removed. Mentioned persons (@ mentions) remain as plain text without an e-mail link. The comment text itself and regular web links are kept.

Not in headers and footers

Snippets with comments cannot be inserted into headers or footers, footnotes or endnotes. Generation fails there, because Word does not allow comments in these places.

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.