A .docx template is an ordinary Microsoft Word document with merge fields in it. A merge field is a placeholder that Word shows as «FieldName». When you print, Qoblex replaces each placeholder with the real value from your order, invoice, refund or shipment, and gives you the result as a PDF.
You keep full control of fonts, colours, logos, layout and wording. Qoblex only fills in the data. This article explains the ideas once, in plain language. The field lists for each document type are in the articles that follow.
The basic idea
Think of a mail merge. You write the page once, with gaps where the data goes. Qoblex fills the gaps for each document you print.
For example, a template that contains this line:
Order «Number» for «Customer.Name»
prints as “Order SO-1042 for Acme Ltd” (your own number and customer name will appear). On an invoice, «Number» still prints the sale order number.
Field names are not case-sensitive, so «Subtotal» and «SubTotal» fill the same value.
Four things are worth knowing from the start:
- The result is always a PDF. Qoblex never gives you back a filled-in Word file.
- Each document type has its own field list. A name can be missing on another type, or mean something else there. «Number» is the order number on a sales document but a batch number inside the batch list on a packing slip. Check the list for the type you are building.
- A merge field is a real Word field. Typing «Number» with the quote characters by hand does not create one.
- Format matters. A number with no format option prints with all its decimals and no thousands separator, a date prints with the time, and a yes/no value prints True or False. See “Options you can type after the field name”.
See Build a .docx template in Word for how to insert fields.
Field names and dot paths
Some values belong to a group, such as the company, the customer or an address. A dot reaches inside the group.
| Field | What it prints |
|---|---|
| «Company.Name» (sales and purchase documents) | Your company name |
| «Customer.Name» (sales and purchase documents) | The customer’s name. On a purchase order it returns the supplier |
| «ShippingAddress.City» (sales and purchase documents) | The city of the shipping address |
| «Supplier.PrimaryAddress.City» (purchase orders) | The city of the supplier’s main address |
A dot path can go several levels deep, as in the last row. If a value is empty, the field prints blank. A packing slip uses plain «Company» and «Customer» instead. The exact names for each document are listed in the field articles.
One more prefix, CustomField:, prints a product custom field on the lines of sales documents and purchase orders. See Docx fields for sales documents and Docx fields for purchase orders for it.
Repeating sections
An order has any number of lines, so the template needs a way to repeat a row. You do that with a pair of fields, RangeStart: and RangeEnd:, followed by the name of the list.
Put «RangeStart:OrderItems» in the first cell of a table row, and «RangeEnd:OrderItems» in the last cell of the same row. Everything between them repeats once per product line.
This is how the row looks in Word:
| Product | SKU | Qty | Price |
|---|---|---|---|
| «RangeStart:OrderItems»«ProductName» | «SKU» | «Quantity» | «Price»«RangeEnd:OrderItems» |
An order with two lines prints like this:
| Product | SKU | Qty | Price |
|---|---|---|---|
| Blue mug | MUG-BLU | 2 | 8.50 |
| Red mug | MUG-RED | 1 | 8.50 |
The heading row is outside the range, so it prints once.
Inside a range, only the fields of that list fill in. A field from the rest of the document, such as «Number», prints blank there. The name after RangeEnd must match the name after RangeStart, or the print fails.
Repeating more than a table row
The starter sales and purchase templates repeat a table row. The starter packing slip also repeats paragraphs inside a table cell for its batch numbers, with a batch range inside the item range.
Where the two fields sit decides what repeats:
- In the first and last cell of one table row, the row repeats.
- In one paragraph, the items run on together in that paragraph.
- In two different paragraphs, every paragraph between them repeats for each item.
Print a sample order to check the result.
Lists with nothing in them
Qoblex removes a repeating section from the PDF when the list has no entries. The starter sales template has a second range for extra cost lines, «RangeStart:CustomItems». An order with no extra cost lines prints no row for it.
Anything outside the range stays. If the range sits in a table, the table’s heading row still prints on its own.
Apart from the Html: line described below, Qoblex does not tidy anything outside a repeating section. A field with no value prints blank and leaves its line in the page.
Formatted text with Html:
Notes are written in a rich-text box, so they can hold bold text, lists and line breaks. To keep that formatting on paper, put «Html:Notes» in the template instead of «Notes».
The starter sales and purchase templates use «Html:Notes» in the last row of the table.
Put the field on a line of its own. Notes can contain whole paragraphs, and the notes replace that line, so no gap is left behind. With no notes, the line disappears.
Do not put text on the same line. Notes break out onto their own lines and split the text around the field.
Pictures with Picture:
«Picture:Image» prints the variant’s image, or the product’s first image if the variant has none. The starter templates use it in the line-item row.
In the starter templates, a small placeholder picture sits next to the field. The easiest way is to copy that image cell from a starter template, then check the size in a test print.
Images depend on your products. Test with an order whose products have images and one whose products do not, so you know how both look before customers see them. Also use common fonts and check the test print.
Options you can type after the field name
Word fields accept extra switches after the name. Without one, Qoblex prints the raw value.
| You want | Add | Example result |
|---|---|---|
| A number with two decimals | \#0.00 |
1247.07 |
| Two decimals and thousands separators | \# "#,##0.00" |
1,247.07 |
| A date without the time | \@ "dd MMM yyyy" |
20 Oct 2026 |
| A long date | \@ "dddd, dd MMMM yyyy" |
Tuesday, 20 October 2026 |
Always add a date switch. Without one the date prints with the time, in a style that can vary. A yes/no value such as «HasDiscount» prints True or False. The starter sales template wraps its discount sentence in a Word IF field so the text shows only when the value is True. Copy the field from a starter template when you want the same look.
What happens with unknown fields
If a field name does not match anything on that document, the field prints blank. There is no error and no placeholder text, so a misspelled field looks like an empty value.
When a value is missing from a printed PDF, check the spelling against the field list for that document type. A field that exists only on a different document type is unknown too.
If printing fails altogether, Qoblex does not say which field caused it. See Troubleshooting .docx templates.
Printing several documents at once
Only Packing Slips print several documents into one PDF. Open the Packing Slips dialog in either way:
- On the Sales list, select orders and choose Packing Slips.
- On a sale order with the Order tab showing, click the printer icon and choose Print Packing Slip.
Qoblex fills your template once per shipment and joins the results into one PDF.
- Each slip starts on a new page and keeps your template’s page setup and headers and footers.
- An order with several shipments gets one slip per shipment.
- An order with no active (non-draft, non-cancelled) shipment gets a slip only when you tick “Include orders that are neither picked nor packed.”
Design your template as one slip. Sales orders, invoices, purchase orders and refunds are printed one document per PDF.
Categories and the documents they print
When you add a template you choose a Category. Qoblex only offers the template when you print documents of that category.
| Category | Documents it prints |
|---|---|
| Sales | Sales orders and invoices, including the PDF attached when you email them |
| Refunds | Refunds, from the refund page (see the warning below) |
| Purchases | Purchase orders, including the PDF attached when you email one or send it for approval |
| Packing Slip | Packing slips, from the Packing Slips dialog (Sales list or a sale order) |
A template belongs to one category. A Sales template serves both orders and invoices, so print a sample of each before you rely on it. See Docx fields for sales documents for the fields.
Product Labels can only be made in the built-in designer, so they have no .docx category.
Qoblex provides starter files for Sales, Purchases and Packing Slip. There is no starter file for Refunds.
Which template prints
In the Print Document dialog, Qoblex lists the templates of the matching category, built-in designs and .docx templates together. Your first template in that list is preselected. On purchase orders, the list also includes your product label designs.
Once a category has at least one of its own templates, the built-in layout (listed as Default Template) is no longer offered in that dialog. If you want the original layout back, delete the custom template.
Where to manage templates
Go to Account Settings and click Documents to open the Branding and Customization page. The Document Customization section lists your templates, and Add .docx Template opens the Document Template Editor, with Template name, Category and Template .docx file. The next steps are in Upload and test a .docx template.
Only .docx files up to 5 MB are accepted. Qoblex does not check the file’s content on upload, so a faulty template only shows its problem when you print.
Keep reading: Build a .docx template in Word.