Skip to content

Conditional clauses in Word: include or remove paragraphs automatically

Published · Updated · Automating Word templates

Most contracts and letters have parts that only apply sometimes: a retainer, a guarantor, a bonus, a jurisdiction clause. Here is how to make Word documents include or drop those parts automatically.

Yes/no sections

{#has_guarantor}
GUARANTEE
{guarantor_name} guarantees the tenant's obligations.
{/has_guarantor}

Clausery asks "Has guarantor?" and removes the whole block, including its paragraphs, when the answer is no. Questions inside the block, such as the guarantor's name, are only asked when the answer is yes.

Either/or wording

{#is_remote}This is a remote position.{/is_remote}{^is_remote}You will work from our {office} office.{/is_remote}

{^…} is the opposite of {#…}: it keeps its text when the answer is no.

Clauses based on amounts, dates or choices

A section does not have to be a yes/no question. In the designer, change the section's question to Computed and give it a rule such as salary > 100000, fee_type == "flat" or years_between(start_date, today()) >= 5. The clause appears when the rule is true. See logic and calculations for everything the rules can do.

Avoiding blank lines

Put the opening and closing tags each on their own line, as in the examples above. Clausery then removes those lines along with the section, so the document never has gaps where a clause used to be.

Try it with your own document

More on automating Word templates

All guides

NDAs and restrictive covenants

Hiring and HR letters

Freelancing and getting paid

Landlords and tenants

Business deals, money and releases