Word-file templates
A template’s Source Type decides where you build it: in the Sliick Docs editor, or in a Word file. With a Word-file template, you write tags in the Word document, and Sliick Docs fills them in and makes the PDF or Word file when someone generates a document. Choose this when the document already exists in Word, or when legal or brand teams outside Salesforce own its wording.
The easiest way to write the tags is the Word add-in. It inserts tags from a list of your org’s fields, checks them, and saves the document to Salesforce without leaving Word. You can also write the tags yourself and upload the finished document from the Template Library, with no add-in needed.
Upload a Word document
Section titled “Upload a Word document”To make a template from a Word file you already have (new in 3.4):
- In the Template Library, click New Template, then Upload a Word document.
- Enter a Template Name and pick the Base Object. A test record is optional.
- Under Formats this version makes, PDF is ticked to start with. Tick Word as well, or instead. At least one must stay ticked.
- Choose the Word file (.docx). It can be up to 3 MB. For a larger file, or one with large pictures, save the document from the Word add-in instead, which takes files up to 64 MB.
- Click Create template. The editor opens on the new draft. Proof it and publish it as usual.
If the file is refused, for example because it is too large or is not a real .docx file, the form says why, keeps what you typed, and asks for another file.
A Word-only save skips the PDF check (new in 3.5). With only Word ticked, the save checks the file and its tags but not whether it can be a PDF, so a long Word document saves. To make PDFs later, use Re-publish with PDF ticked: it checks the stored file for PDF and stores its pictures, with no new upload. You can also tick PDF on a draft: the next save or upload checks the document. Until then the Output tab says “Tick PDF to make PDFs. The next save checks the document.”
Only users with Sliick Docs Admin or Sliick Docs Template Author can upload a Word document or a new version of one.
A template’s Word file must be a file you uploaded yourself, whether you upload it here or save it from the Word add-in. A file someone else uploaded is refused, even if it was shared with you: upload the document from your own computer instead. This stops a confidential file from becoming readable by everyone who can use the template. The add-in always uploads a fresh copy as you, so saving from Word is not affected.
Uploads that never become a template, for example when you close the browser tab halfway through, are cleaned up automatically.
What you can write in the file
Section titled “What you can write in the file”- Merge fields and conditions. Write merge fields as tags. Wrap optional content in
{{#if}}blocks. You can put one{{#if}}inside another, so an optional clause can sit inside another optional clause. If a tag is not closed properly, the upload is refused with a message that names the tag, says where it is, and how to fix it. - Whole numbers.
{{Qty:integer}}prints120rather than120.00, the same as the Whole number format in a designed template. See Merge field formats. - Barcodes. Barcode tags become real barcodes in the PDF, sized to fit the page. Add
:nohrito a barcode tag to hide the line of text that normally prints under it. If a barcode cannot fit, its value prints as plain text instead, and the reason is shown on the template’s info card when you proof it, and in the generation history when it runs. A document never goes out with a raw tag or a barcode that will not scan. - Signature tags. Write
{{@Signature:Role:Order:Type}}where a signature belongs. When the document is sent for signature, Sliick Docs places the signature field there and builds the list of signers from the tags. See Signature tags. - Lists of related records. Repeat a table row or a block for each child record, filter and sort the list, show only the first few rows with
LIMIT, or group the rows withGROUP BYand give each group a heading and a subtotal. See Tables, conditions, images and barcodes. - Links. A
:linktag works in the body, in every header and footer, and in footnotes and endnotes. - Symbols. Symbols added with Insert > Symbol in Word print in the PDF, as long as the PDF supports that symbol. One it cannot print is named in a warning on the generation.
- Chinese, Japanese and Korean text prints in the generated document.
The editor for a Word template
Section titled “The editor for a Word template”A Word template opens in the same editor as a designed one:
- the top bar,
- a list of merge tags on the left,
- a PDF preview of the document, filled in with your test record, in the middle,
- tabs on the right.
A Word template label next to the status tells you which kind of template you are in. A published Word template shows Published. A draft with nothing left to fix shows Ready to publish.
The right side has four tabs:
- Source: the Word document the template was made from. Download the exact
.docxthat is stored, and see who saved it and when, the base object, the test record, the status, how many merge tags it has, and the live version. - Output: which formats the template makes, and whether a PDF is possible. A readiness section tells you what would stop this document becoming a PDF, how long it is, which characters will not appear, and which parts will look different from Word. A finding in the body of the document says roughly where it is, for example about page 3. The page is approximate, taken from the page markers Word saved in the file, and is left out when the file has none. This is information, not a warning: a Word-only template is not broken. Here you also find the Formats this version makes card, where you tick PDF, Word (.docx) or both, and the Salesforce values in Word setting. See Word output.
- Template: file name, compliance, watermark, visibility and specific records.
- E-sign: signer roles and signature fields. See Setting up a template for signature.
There is one Save button, in the top bar. Changes on any tab are kept until you click Save, whichever tab you are on. Generate proof and Publish sit next to it. There is no separate Word preview button: Generate proof makes every format the template produces.
The preview in the middle uses the document’s own page size and the same fonts as the PDF, and scales with your window, so lines break where they will in the PDF. Calibri shows as Carlito, the font it prints in. Page 1’s own header shows at the top and its footer at the bottom. It only appears when the document can be made into a PDF.
Proof and publish
Section titled “Proof and publish”A proof shows you how Sliick Docs will turn your Word file into the finished document, before a customer sees it. The PDF is made from your Word file, so a missing header, a lost picture or a broken table shows up in the proof first. Proofs are listed under Generated proofs, the same as for a designed template.
- A proof is made in each format the template produces. It also tries a PDF whenever the document can be one, even if this version does not make PDFs, so you know where you stand if you add PDF later.
- If a proof cannot make the PDF, it tells you why, for example “Split this into smaller templates - it’s too long to make a PDF from.” There is no fixed length limit.
Publishing takes effect on the click, and a proof is made in the background afterwards, the same as for a designed template. You do not need a proof or test record first. See Proof, publish and versions.
Publish is only greyed out when the document needs fixing, and Sliick Docs names the fix: a merge tag that does not match a field, or, when PDF is ticked on the draft, a document that cannot become a PDF or pictures that were not stored. A Word-only draft can be published even if its PDF checks fail. Unticking PDF is always allowed, so it is the way out if a publish is stuck on the PDF.
Each version makes the formats it was published with. To add PDF to a template published as Word only, click Re-publish…, tick PDF, and click Publish. See Re-publish. Your users keep getting Word until it is live. This works for a template saved Word-only too: Re-publish checks its file for PDF then. Its live version’s Output tab says “This version makes Word only. To add PDF, use Re-publish on this template in the Template Library.” A version published before 3.2 keeps making the formats its old settings chose until you publish a new one.
Once a Word template is published, users can Preview it on the record page before generating, the same as a designed template.
Pictures
Section titled “Pictures”The Word add-in and Upload store each of a document’s pictures as a separate file, and save the rest of the document without them. That is how a document with tens of MB of photos can be saved. The pictures stay with that version. For the PDF, they are prepared only when you save with PDF ticked: a Word-only save leaves that to the next save with PDF, or to Re-publish… with PDF. Every proof, preview, publish and generated file uses them, so everyone who generates from the published template sees them, not only the person who published it.
- Saving from the Word add-in: a file can be up to 64 MB. The add-in shows “Uploading picture 1 of 12…” while it works. If it cannot store a file’s pictures separately, the save results say so, and Word output from that version won’t be available. PDFs work as usual.
- Upload: a file can be up to 3 MB. Use the Word add-in for larger files, or for large pictures.
- Download source in the editor gives back exactly the Word file that was saved, pictures included. If it says “To download this Word file, save it again from Word with the Sliick add-in, or upload it again.”, do that once.
Action needed after upgrading to 3.5: a Word template with pictures that was saved before 3.5 no longer makes Word files. Generating Word from it, or publishing it with Word ticked, says “Open this template in Word and save it again with the Sliick add-in, or upload the .docx again, then publish.” Do exactly that: open the document in Word and save it with the add-in, or use Upload a new version, then publish. PDFs from the template are not affected and keep working in the meantime. A document with no pictures is not affected either.
Large pictures in Word files. A Word file with many large pictures can be too big to make while you wait, and fails with Salesforce’s own memory error. On the record page, tick Generate in background, or choose PDF. See Generate in background.
- There is no limit on the number of pictures. Saving pictures takes Salesforce time; a save Salesforce cannot finish stops with Salesforce’s own error, and nothing is saved.
- A draft saved Word-only has no stored pictures. A PDF proof or publish of it shows “Save or upload the document again to include its pictures.” Saving once from the Word add-in, or using Upload a new version, with PDF ticked fixes it.
- PDFs can show PNG, JPEG, GIF and BMP pictures. Other formats are listed in the readiness section and cannot go into a PDF. The most common is EMF, which Word uses for anything pasted from another Office app and for most logos drawn as shapes. An SVG inserted in Word works, and pictures from old Word 97-2003 documents print.
- If a picture is missing from the file itself, the proof, the add-in preview and the generated document all say so, rather than leaving a silent gap.
How the PDF follows Word
Section titled “How the PDF follows Word”The PDF is made from your Word file, and each release brings it closer to what Word prints. Word output itself is unchanged: Word draws these things on its own.
- Fonts. Calibri, Cambria, Georgia and Segoe UI print in built-in look-alike fonts with the same letter widths, so line and page breaks stay close to Word. A font that is not built in or added by your org is replaced with a standard font, and never blocks a save or a publish. See Themes and branding.
- Table styles. The shading and text colours of a Word table style print, including header rows, first columns and banded rows. A table with a row that repeats or only shows sometimes prints without alternating row shading.
- Headers and footers. A tall header or footer no longer costs a page, and even-page headers and footers, and each section’s own, print as in Word. Anything the PDF cannot draw yet adds a warning to the generation: “Some headers or footers may not match the Word document.”
- Colours and text size. Theme colours, including tints and shades, print in Word’s colour. Text with no size set anywhere prints at Word’s 10pt.
- Hidden text. Text formatted as hidden in Word (Font > Hidden) does not print in the PDF, as Word leaves it out.
- Conditions. Text, pictures and symbols beside a condition that is false still print, and a false condition leaves no blank line behind.
- Ruled tables. A table’s top and bottom borders take their full height, so pages break where Word breaks them.
- Tab-only lines. A line that holds only a tab keeps its height, as in Word.
- Floating pictures and text boxes. One that reaches into a page margin is moved just inside the margin, in the body, headers and footers. One placed from the top of the page near the start of the document prints on page 1. A floating picture that cannot be placed prints in line with the text, scaled to fit. A page-sized picture set behind the text prints behind the text, shrunk to fit inside the margins. Save and publish notes list what was moved or printed in line.
- Watermarks. A watermark set in Word prints behind the text. See Watermarks from Word.
- File names. A file-name pattern on a Word template fills in every field it names, including parent fields such as
{{Opportunity.Account.Name}}. See File names.
A live template keeps its current PDF until someone uses Re-publish (or publishes a new version). When a newer way of making the PDF is available, the Template Library card says “A newer PDF rendering is available. To get it, use Re-publish.”
Some Word items are left out of the PDF. A PDF made inside Salesforce leaves out what it cannot draw, and keeps the rest of the page: rotated or oddly shaped text boxes, drawing shapes and groups, charts, SmartArt, embedded objects, equations, footnotes and endnotes, and pictures in formats such as EMF or TIFF. The Word file keeps all of them. When you save, the results list each one with about which page it is on, and publish and the proof say so again. Premium rendering draws some of the text boxes the built-in PDF leaves out.
A few things still stop a PDF: tracked changes, fonts embedded in the file, and a text box that holds only part of a {{#…}} section. Fix those in Word, or publish the template with Word only.
Watermarks from Word
Section titled “Watermarks from Word”A watermark set in Word (Design > Watermark) prints in the PDF, behind the text, on every page. A watermark that is only in the first-page header prints on page 1 only. It prints whole on every page, even when the document’s sections have different margins or a tall header, but on the larger pages it may sit slightly off centre. The Word file’s watermark replaces any watermark set in Sliick Docs for that template.
- Picture watermarks print centred, at the size set in Word, scaled down to fit inside the margins. EMF and WMF pictures are left out.
- Washout: a picture watermark with Washout ticked prints faded, as Word shows it, when the file is saved from the Word add-in or uploaded. A file saved before 3.5 prints the picture unfaded.
- Text watermarks, such as DRAFT, print diagonal and see-through, as in Word. Sliick Docs draws them when the file is saved from the Word add-in or uploaded in the Template Library. A file saved before 3.5 says “The Word text watermark isn’t drawn yet.” Use Re-publish once to print it.
New versions
Section titled “New versions”A Word template’s document only changes when you give it a new file. There are two ways to do that:
- Save from the Word add-in. See Check and save. The add-in’s Save form has Output formats boxes, PDF and Word: a new template starts with PDF, and an existing one with the formats its next save gets. Saving into an open draft replaces its Word file and its formats.
- Upload a new version. Click it in the editor, or on the template’s card in the Template Library. It only shows on Word templates. Before you pick a file, it tells you what will happen.
Before a template is first published, a new file updates the current draft. After it is published:
- If a draft is open, the new file replaces the draft’s Word file and its formats. Nothing is published until you publish the draft.
- If there is no draft, the new file creates a new draft version. Your users keep the live version until you publish it.
- While a draft is publishing in the background, an upload is refused. Wait for the publish to finish, then upload again.
The template keeps its name and base object.
Re-publish
Section titled “Re-publish”Re-publish… publishes a live Word template again without a new file. Use it to change which formats the template makes, or to pick up a newer way of making the PDF. It replaces New Draft, Create draft and Publish again from stored file, which no longer appear on Word templates. Designed templates still use New Draft and Create draft.
Re-publish… is on the live version’s row on the Template Library card, and on the editor’s top bar when the live version is open. It is hidden while a draft is open: publish or delete the draft first. To change the formats of a draft, use its Formats this version makes card and publish it.
- Click Re-publish….
- The PDF and Word ticks start at the live version’s formats. Change them if you need to. If you untick a format your users rely on, you see a warning first, because Flows and batches that ask for it will stop.
- Click Re-publish (or Publish, if you changed the formats).
Re-publish starts a new version from the exact Word file the live version was published from, checks it again, and publishes it in one step. No test record is needed, and a proof follows as after any publish. When PDF is ticked, the PDF is made again with today’s improvements, so it can look slightly different from the live one.
If the publish is refused, for example because the document cannot become a PDF or is too long (“This document is too long to publish as a PDF. Split it into smaller templates.”), nothing is created and the live version is unchanged. The dialog says why. A long document can publish in the background, the same as any publish. With PDF ticked, 5,000 paragraphs published in the background, and 8,000 were refused as too long. A Word-only Re-publish of a very long document (about 8,000 paragraphs) can instead stop with Salesforce’s own time-limit error; the live version is unchanged then too.
Replacing the file directly in Salesforce Files does nothing. Each version keeps generating from the exact
.docxit was published from, and Re-publish starts from that same file. To use a new file, save it from Word or use Upload a new version.
Source Type is fixed once a template is published, and so is its base object. If a save would change either one, Sliick Docs refuses it and explains why: every published version depends on them.