Copy text fragments to Word document

In the previous article we created a small model in which we added a text fragment. We will now explain how to put this text fragment in your Word document. The first step is to simply left click your text fragment in the Berkeley Studio. This is done in the Text Fragments screen:

Copying the text fragment
Copying the text fragment

After you have done this, open your Word template. In the template, you can now paste (either with [Right click > Paste] or [Control + V]) the text fragment at the right place. This should look the same as in the image below:

The result
The result

The text fragment is now placed in your document. Save your mode, run it and download the document (if you have added one), and you will see that your input is automatically placed in the document.

Technical explanation

A text fragment in Word is just a piece of text, telling the Runner or Server to replace that piece of text with the content of a text fragment. That piece looks like <text name="x"/>, where x is the name of the text fragment. Older versions had <textfragment name="X"></textfragment> to describe a fragment in Word. This still works, but <text name="x"/> is much shorter. The quotes ("") are there to make sure spaces and other strange characters do not intervene, but if you use just the character ‘a’ through ‘z’, those quotes can be omitted as well, making it even more shorter; <text name=x/>.