Word templates
Word add-in
The Word add-in is a sidebar in Microsoft Word that helps you write Moliri templates. It brings no syntax of its own; it inserts the same commands that this area describes. A template made with it is not tied to the add-in.
The template editor in the browser can do more: formatting on insert, the check, the preview, output settings and field annotations in the report. The add-in is for everyone who prefers to write their templates in Word.
Installation
The add-in is not available in the Microsoft Store. You add it through its manifest address (sideloading):
https://addins.moliri.app/manifests/manifest.word.xml
The steps differ by platform. Microsoft’s instructions:
In organisations, IT can also deploy the manifest centrally. Support at [email protected] helps with the setup.
After installation, the Home tab has a group of its own for the add-in with the button Open Sidebar. It opens the sidebar.
Connect to Moliri
-
The first time you open it, the sidebar asks for the Moliri domain, the address of your Moliri instance, for example
https://museum.moliri.app. -
Save domain. The add-in loads the field list of the connected instance.
The address is remembered. Change connection at the top of the sidebar chooses another one.
What the sidebar offers
| Section | Function |
|---|---|
| Live editor | If the cursor is inside a command {# … #}, the command appears here for editing. Changes go straight into the document |
| Field-based snippets | Choose a field and the matching command is inserted at the cursor. There is one selection each for text field, image field and number field |
| Important variables | $o, objects, f, p, $f, files with an example to insert |
| Rules that prevent errors | Notes on loop variables, files and how to write field names |
| Highlight patterns | Marks all commands in the document in yellow. Remove highlights takes the marking away again |
| Preset library | Ready-made patterns by topic, with search: fields, loops and conditions, files and images, formatting, project, grouping |
The field building blocks produce these commands:
| Selection | Inserted command |
|---|---|
| Text field | {#$o[`Feld`]#} with an empty fallback |
| Image field | {#IMAGE img(($o[`Feld`]??null),{width:8,height:8})#} |
| Number field | {#$o[`Feld`] ? imask($o[`Feld`], f[`Feld`]) : `-`#} |
A typical workflow
-
Open the Word document and start the sidebar with Open Sidebar.
-
Place the cursor where you want it and insert a field or a preset.
-
Adjust the inserted command, in the live editor if needed.
-
Upload the file to Moliri and test it with two or three objects, see Create a Word template .
Continue in the template editor
You can upload a template started in the add-in and carry on editing it in the template editor (Edit in EuroOffice). For these tasks that is the way to go:
| Task | How |
|---|---|
| Insert a formatted field value | Write ffmt($o, `Feld`) in the add-in, see Output formatters in templates |
| Format a date or a switch | Write fdate and fcheck in the add-in, see Template functions |
| Set object mode, section behaviour and content controls | Save in the template editor, see Settings travel in the document , or choose for a single run in the export dialog under Advanced settings |
| Carry a field’s colour, comment and source over into the report | In the template editor under Additional details, see deco |
| Check the template, preview | After uploading to Moliri |
Further reading
- Create a Word template : template editor and uploading
- Recipes : patterns to copy
- Template syntax