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

  1. 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.

  2. 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

SectionFunction
Live editorIf the cursor is inside a command {# … #}, the command appears here for editing. Changes go straight into the document
Field-based snippetsChoose 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 errorsNotes on loop variables, files and how to write field names
Highlight patternsMarks all commands in the document in yellow. Remove highlights takes the marking away again
Preset libraryReady-made patterns by topic, with search: fields, loops and conditions, files and images, formatting, project, grouping

The field building blocks produce these commands:

SelectionInserted 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

  1. Open the Word document and start the sidebar with Open Sidebar.

  2. Place the cursor where you want it and insert a field or a preset.

  3. Adjust the inserted command, in the live editor if needed.

  4. 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:

TaskHow
Insert a formatted field valueWrite ffmt($o, `Feld`) in the add-in, see Output formatters in templates
Format a date or a switchWrite fdate and fcheck in the add-in, see Template functions
Set object mode, section behaviour and content controlsSave 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 reportIn the template editor under Additional details, see deco
Check the template, previewAfter uploading to Moliri

Further reading