3.20

@@InsertSection/@@EndSection

The @@InsertSection and @@EndSection statement pair is an alternate method for placing sections within a document. @@InsertSection has the advantage over @@BeginSection of being conditional, meaning you can have the section only inserted when a desired condition is met. If using @@InsertSection in a template already containing Word section breaks, place the @@InsertSection statement just after the Word document section break and the @@EndSection just before the next section break, or the end of the document, whichever comes first. Each @@InsertSection must be followed by a @@DefineSection of the same name.

Syntax:

@@InsertSection(<name>, <test>)

Parameters are:

<name>

A text string, enclosed in single quotes, that specifies the name of a section to insert.

<test>

An optional expression that evaluates to True or False. When the condition is true, the doc processor inserts the section into the document. If you do not provide a test, the doc processor automatically inserts the section. You can use tokens as part of the test.

When testing on a string (non-numeric value), enclose the data in single quotes. When testing on a number, do not use single quotes.

Use Or and And for testing multiple conditions. Or evaluates to true when any of the conditions are true. And evaluates to true only when all of the conditions are true.

You can use the following test conditions:

=

equals

<>

does not equal

<

less than (only allowed with numeric data)

>

greater than (only allowed with numeric data)

 

Examples

Example 1

@@InsertSction('Terms')
@@DefineSection('Terms')
@@Include

This content will always be included in the output document.

@@End
@@EndSection

Example 2

@@InsertSection('NewBusinessAssumptions', #Proposal.IsRenewal = 'N')
@@DefineSection('NewBusinessAssumptions')
@@Include

This content will only be included in the output document if the proposal is not for renewal.

@@End
@@EndSection

Example 3

@@InsertSection('RenewalAssumptions', #Proposal.IsRenewal = 'Y')
@@DefineSection('RenewalAssumptions')
@@Include

This content will only be included in the output document if the proposal is for renewal.

@@End
@@EndSection