Table of Contents

Highlighting Word documents

Maarten Truyens Updated by Maarten Truyens

Creating templates in ClauseBuddy starts with highlighting words in an existing DOCX (Word) document. While very easy to get started with, there are few details you may want to be aware of.

If you are using ClauseBuddy from within ClauseBuddy, you may not have enough space on your screen if you do not have a large monitor. If so, you may want to put Microsoft Word in Web Layout View instead of the default Print Layout. You can do so by visiting the View tab in Word's ribbon, or by clicking on the relevant button in Word's status bar at the bottom of the window.

You can then make your document panel at the left side smaller, and Word will wrap the document's text in the available window. This allows you to make more room for ClauseBuddy.

Highlighting in cyan

In ClauseBuddy, placeholders must be highlighted in cyan (light blue).

This color was deliberately selected, because most legal experts tend to already use yellow for various purposes (such as internal comments, temporary internal notes, and — admittedly — also placeholders).

You can switch to cyan highlighting by clicking the down-triangle within the Microsoft Word toolbar:


A placeholder is a piece of text that will get replaced by an answer to an associated question within the questionnaire. For example, in the following sentence, the order amount and the delivery date are placeholders, highlighted in cyan.

When you then create two questions corresponding to those placeholders, ClauseBuddy will automatically replace the cyan words with the answer to those questions. 

Conditional text

Conditional text is created by highlighting a condition + colon + conditional text. In the following example, the text "taking into account Customer's preferred delivery schedule" will only be shown when condition "softened" is met.

You can "chain" multiple conditions by inserting the vertical pipe symbol. For example, instead of writing can also write the following, which more clearly expresses the author's intent that one of several options will need to be chosen. ClauseBuddy will then insert the first text for which the associated condition is met:

If each of the conditions has a structure similar "x = y", you can also write this more concisely:

Another advantage of using the pipe operator is that you can easily insert a final "catch all" part — using else: — which will apply when none of the previous conditions was met.

Conditional paragraphs

An entire paragraph can be subjected to a condition by positioning that condition at the start of the paragraph. For example, the following paragraph will only be shown when the delivery location is known (also note the "location" placeholder, which will be replaced by the actual location, as answered by the end-user):

There are many different ways to express conditions, as further explained in the separate article on conditions.

Dealing with automatic numbering

The question arises what happens to the numbering of subsequent paragraphs when an entire paragraph is dropped because some condition is not met.

For example, assume that the delivery location is not known, so that the second paragraph will get dropped in the next example. When the end-user creates a PDF or DOCX file, ClauseBuddy will automatically update the numbering, so that the last paragraph ("Some subsequent paragraph") will get number 2.

However, this only functions correctly when you are properly using Microsoft Word's automatic numbering features. When, instead, you would "hardcode" numbers — i.e., explicitly type in the number of each paragraph — your document will get stuck on incorrect numbering.

This is yet another reason to use automatic numbering and MS Word "styles" to format your documents. We are aware that "in the wild" many legal documents do not yet use automatic numbering (or, even worse, use a mix of automatic and manual numbering).

However, there are countless benefits (e.g., automatic TOCs, automatically updating cross-references, easy layouts, etc.) to learning and applying such automatic numbering.

Do note that — due to the complexity involved — the automatic changes in the numbering will not be shown interactively on the screen. You can rest assured, however, that everything will be correct when you ask ClauseBuddy to create a DOCX or PDF file.


ClauseBuddy will automatically remove multiple consecutive spaces that happen to get inserted due to conditional text.

In the following example, the condition "softened" will cause softening language to get inserted. If that condition is not met (so that the ", acting reasonably," gets removed), you would end up with two consecutive spaces (one space exists after Supplier and one exists before will). In such scenarios, ClauseBuddy will automatically remove the double space.

Note that ClauseBuddy will never insert additional spacing: it will only remove multiple consecutive spaces caused by conditional text.

How did we do?


Creating cards and questions