# Word documents from templates

## <span class="mw-headline" id="bkmrk-basic-template-1">Basic template</span>

### <span class="mw-headline" id="bkmrk-checklist-1">Checklist</span>

1. \[Solution\] &gt; "Advanced" &gt; Template: "Add" 
    - Copy template tags from popup: "Template field tokens" &gt; "Office"
2. Prepare file on local PC 
    - Copy placeholder tags from backend
    - Save in safe location so you dont need to download when updating later
3. \[Solution\] &gt; "Advanced" &gt; Template: "Add" 
    - Set content type to "MS Word" or "PDF"
    - Upload file
4. If solution has more than 1 export template 
    - Check that solution has \[Solution\] &gt; "Advanced" &gt;"Template selector" enabled

[![Tutorial wordtemplate.PNG](https://wiki.tsnocode.com/images/c/ce/Tutorial_wordtemplate.PNG)](https://wiki.tsnocode.com/index.php?title=File:Tutorial_wordtemplate.PNG)

### <span class="mw-headline" id="bkmrk-trouble-shooting-1">Trouble shooting</span>

Content from TempusServa is not displayed inside tags

- Disable spelling/grammar
- Take care not to edit the text inside tags
- Select the whole tag before applying styling
- Paste tags from notepad or other program without text styling
- Try the "Fix word tags"-codeunit (insert link)

## <span class="mw-headline" id="bkmrk-subtemplates-1">Subtemplates</span>

Subtemplates can be used for special fields that support the notion.

- Complex question

The whole sub template is injected into the tag, as if it had been normal data.

### <span class="mw-headline" id="bkmrk-complex-questions-1">Complex questions</span>

Supported tag names

```
${FIELDLABEL}
${FIELDHELP}
${CHOICEIMAGE}
${CHOICELABEL}
${CHOICETEXT}
${ANSWERLABEL}
${ANSWERTEXT}
${PICTURE}
${COMMENT}
```

### <span class="mw-headline" id="bkmrk-complex-questions-3">Complex questions</span>

Supported tag names in first template

```
${FIELDLABEL}
${FIELDHELP}
```

Supported tag names in second template

```
${LOCATION}
${CHOICEIMAGE}
${CHOICELABEL}
${CHOICETEXT}
${ANSWERLABEL}
${ANSWERTEXT}
```

### <span class="mw-headline" id="bkmrk-special-consideratio-1">Special considerations</span>

Named styling is not supported, but can work with a workaround.

1. Copy styled content from subtemplate
2. Paste into main template and save file
3. Remove content and save again

### Sections

Sections that are shown based on boolean test

```
```

## <span class="mw-headline" id="bkmrk-trouble-shooting-3">Trouble shooting</span>

### <span class="mw-headline" id="bkmrk-table-page-flow-1">Table page flow</span>

Word does not respect table setting for page flow, so table rows break in undesired ways

1. Create a new empty table with one cell (without borders)
2. Right-click cell and disable "Allow row to break across pages" / "Tillad opdeling af række"
3. Paste the old table into the new table

  
[![RowControl.PNG](https://wiki.tsnocode.com/images/3/36/RowControl.PNG)](https://wiki.tsnocode.com/index.php?title=File:RowControl.PNG)