Microsoft Word

Introduction

Once in the Microsoft Word editor, all the functions of Word are available to use in your template, such as graphics, tables, styles, hyperlinks and so on. For more information on editing documents in Microsoft Word consult the Microsoft Help by pressing F1 whilst in the Microsoft Word editor.

No support, advice or maintenance services will be provided by us with respect to Microsoft Word. However, we may, from time to time, give you reasonable advice or technical support on an ex gratia basis only. This means that, as the software is not ours, we may, at our sole discretion, try to help you with respect to it. We will not charge you for such help, which will be provided as Extra Contractual Support as defined in clause 4.6 of the terms and conditions of our Annual Software Licence and Customer Service Agreement.

 

If editing an existing template, or the template that has been created has been based on an existing template, the contents of that template will be shown in Microsoft Word and can be altered as necessary. Otherwise a blank document will be shown and the template contents can be entered.

 

Field codes

When using Microsoft Word for editing AutoMail templates, it is recommended that field codes are switched on.

Select Tools | Options and select the Field codes box on the View tab to switch them on.

 

Back to top


 

Creating the document

Begin typing the text of the letter into the document template. The template formatting will be based on the formatting set in Microsoft Word, and the addition of tables, graphics, styles and so on, will all be reflected in the template if they are produced in Word.


For more information on editing documents in Microsoft Word consult the Microsoft Help by pressing F1 whilst in the Microsoft Word editor.

 

Back to top


 

Adding tags

To add tags from the IRIS database, it is necessary first to have selected the appropriate tags from the Tag Selection screen. Once the appropriate tags are selected, they can be inserted into the document by clicking Insert Merge Field.

In Word 97 and 2000, this is a button with the words Insert Merge Field on it. In Word 2002 and above, it is the square button with horizontal lines across it, just to the left of the Insert Word Field option.

Select the required tag from the list and it will be placed into the document at the point where the cursor is.

Assuming field codes are turned on, the tag will look something like this:

 

{ MERGEFIELD "LMCLAgentName" }

 

The formatting of the tag will be reflected in the output. For example, if the tag is in a bold font, then the substituted information will also be produced in a bold font.

 

Back to top


 

Dates

Microsoft Word allows you to format dates in many different ways. A key format which does not usually appear in Word is the original format (that is, 1st, 2nd, 3rd)

 

Inserting date into document

To insert the current date into the document:

  1. Select Insert | Field and select Date and Time from Categories, and Date from field names.

  2. Choose one of the formats from the list and click OK.

This will insert a date field into the document.

 

The Date field will always insert the current date, even when viewing the AM document through the communications tab.

To ensure the actual date the letter is generated is saved, when viewing the AM document, select the SaveDate field to insert the following:

 

{SAVEDATE  \@ "d MMMM yyyy"  \* MERGEFORMAT}

 

Back to top


 

Headers and Footers

Headers and footers can be created using the standard Microsoft Word feature.

To insert headers and footers into a Microsoft Word template:

Go to View | Header and Footer. Using this feature you can add headers and footers to appear on every page, or ones that differ from page to page.
For more information on this refer to Microsoft Help.

 

Fill-ins

It is possible to set up the template so that information can be entered at the time of merging the letter, for example a custom letter reference. This is achieved by creating a FILLIN field.

To insert a FILLIN field into a document, click Insert Word Field and select Fill-in...

  1. In the Prompt box, enter the text the user will be prompted by, for example, Enter your reference.

  2. In the Default fill-in text box, enter (if required) a default entry for the fill-in field. If this box is left blank then no default entry will be provided, but if text is supplied then the user has the option to enter their own alternative text at merge time.

  3. Select the Ask once option if the system should only prompt once for each merge, rather than each individual letter. If 100 letters are generated and the Ask once box has been selected on the fill-in, the system will only prompt for text entry once and will enter the same text on all 100 letters.

  4. Click OK to create the FILLIN code. The system will display how the prompt will look with default text.

  5. Click OK again to insert the FILLIN code into the document.

It will look similar to the following (assuming field codes are turned on):

 

{ FILLIN "Enter your reference here" \d "Your ref" }

 

The formatting of the tag will be reflected in the output. For example, if the tag is in a bold font, then the substituted information will also be produced in a bold font.

 

Back to top


 

If-then-else statements

It is possible to insert text subject to evaluation of a condition within the template code. For example, different paragraphs of text could be printed on the same letter depending on whether the client is a business or a personal client. The main tool in creating conditional text is the IF statement.

To create an IF statement, select Insert Word Field and choose If...Then...Else...:

  1. Select the field that will be evaluated in the Field name box. The field required must have already been added to the template in the Tag Selection screen.

  2. In the Comparison box, enter the evaluation that will be performed. Typically this will be Equal to, but other options are available.

  3. In the Compare to box, enter the expression to compare the field selected to.

  4. The top line of the IF screen should now read as an evaluation.

  5. In the Insert this text box, enter the text that should be placed in the document if the evaluation is true for the client at the time of merge.

  6. In the Otherwise insert this text box, text can optionally be entered that will be placed in the document if the evaluation is false for the client at the time of merge. If left blank then no text will be printed if the evaluation is false.

  7. Click OK to create the if statement and insert it into the document code.

    It will look similar to the following (assuming field codes are turned on):

{ IF { MERGEFIELD LMCLIsBusiness } = 1 "business" "person" }

 

The formatting of the tag will be reflected in the output. For example, if the tag is in a bold font, then the substituted information will also be produced in a bold font.


It is also possible to combine an IF statement with a FILLIN. This will compare the text the user enters when prompted to an expression, and will then insert the appropriate text dependent on the user's response.

 

To create an IF-FILLIN combination, simply create an IF statement as shown above (using any field in the Field name box)and replace the { MERGEFIELD } command with a FILLIN command, detailed above.

An example of this usage would be as follows:

 

{ IF { FILLIN "Enter 0 for person, 1 for business" \d "0" } = 1 "business" "person" }

 

Back to top


 

Ask statements

Ask statements are used in combination with IF statements to insert text subject to a user-entered condition where more than two choices are given. For conditions where there only need to be two choices, see the section above on combining IF statements with FILLINs.

The Ask statement sets a bookmark in the Word document, which is a value which is entered and stored when the letter is merged. You can then use a separate IF statement to perform conditional tests on the result of the bookmark.

Creating an ASK-IF combination involves two separate steps.


Firstly, create the Ask statement.

  1. Select Insert Word Field and choose Ask...:

  2. In the Bookmark field, enter a name for the bookmark. This name must be unique on the template. A list of bookmarks already used will appear underneath the field. In our example we are calling the bookmark BTP.

  3. In the Prompt field, enter the text the user will be prompted by. For example, Enter 0 for person, 1 for business, 2 for trust.

  4. In the Default bookmark text box, you can enter a default option to set the bookmark to. This value will be placed in the text entry box at the time of merge, and can then be overtyped by the user if they want to choose an alternative option. If you leave this box blank, no default option will be specified. An example in this instance would be 0.

  5. Select the Ask once option if the system should only prompt once for each merge, rather than each individual letter. If 100 letters are generated and the Ask once box has been selected on the ask statement, the system will only prompt for text entry once and will set the bookmark to the same value on all 100 letters.

  6. Click OK to create the Ask statement. The system will display how the prompt will look with default text.

  7. Click OK again to insert the ASK code into the document.

It will look similar to the following (assuming field codes are turned on):

 

{ ASK BTP "Enter 0 for person, 1 for business, 2 for trust" \d "0" }

 

Secondly, you need to create the IF statements required to evaluate the bookmark. More than one IF statement will be required since each IF statement will only evaluate to true or false, and the bookmark has more than two potential options.

  1. Insert an IF statement as described in the above section, using any available field in the Field name box. You should insert the IF statement immediately after the ASK statement already entered, not within it.

In our example, the first IF statement will test to see if the bookmark is equal to 0 (for a person).

  1. In the Compare to box, enter the value 0. In the Insert this text box enter the text "person". In the Otherwise insert this text box, enter any text, for example, 'false'.

    This should create an IF statement similar to the following.

{ IF { MERGEFIELD LMCLClientName } = 0 "person" "false" }

 

  1. Delete the { MERGEFIELD LMCLClientName } section (or whichever field name you have used), and replace it with the name of the bookmark specified earlier, in this case BTP:

{ IF BTP = 0 "person" "false" }

 

  1. Delete the word false and then insert in its place another IF statement, again using any available field in the Field name box.

  2. In the Compare to box, enter the value 1.

  3. In the Insert this text box enter the text business.

  4. In the Otherwise insert this text box, enter the final option trust, since it will default to this text if both of the previous evaluations are false.

The statement should now look similar to the following:

 

{ IF BTP = 0 "person" "{ IF { MERGEFIELD LMCLClientName } = 1 "business" "trust" }" }

 

  1. Finally, delete the { MERGEFIELD LMCLClientName } section (or whichever field name you have used) again, and replace it with the name of the bookmark specified earlier, in this case BTP:

{ IF BTP = 0 "person" "{ IF BTP = 1 "business" "trust" }" }

 

The ASK-IF combination together should look similar to the following:

 

{ ASK BTP "Enter 0 for person, 1 for business, 2 for trust" \d "0" }{ IF BTP = 0 "person" "{ IF BTP = 1 "business" "trust" }" }

 

The tag will probably take up less space in the document when the client details are substituted during the letter generation phase. The size of a template during editing is not necessarily a good guide to the size it will appear when printing.

 

The formatting of the tag will be reflected in the output. For example, if the tag is in a bold font, then the substituted information will also be produced in a bold font. 

However, the formatting of the ASK statement is ignored, since it does not resolve into any particular text within the document. Only the formatting of the IF statement in the ASK-IF combination will be adopted in the merged document.

 

Back to top


 

Arithmetic and formatting numbers

It is possible to perform arithmetic on values transferred from the IRIS database, for example adding the tax liability to the first payment on account.

To do this it is necessary to create a formula. Additionally, the number can be formatted to a specified number of decimal places, printed with a currency symbol, with thousand separators. It is also possible to format the number so it appears in brackets should it be negative.

To create a formula:

  1. Select Insert | Field and choose = (Formula) from the list. Dependent on your version of word, you may then have to click Formula... to get to the formula entry screen. If this is the case, follow these steps to enter the formula. Otherwise see further down.

  2. In the Formula box, leave the = sign where it is, and after it enter a dummy sum such as A+B or similar.

  3. Select one of the Number formats from the drop-down list. For example, the number format #,##0.00 will print the number with a comma separator for the thousands, and then print the number to two decimal places. If the format you require is not available in the drop-down list, you can enter your own. For guidance on creating custom number formats, consult Microsoft Help by pressing F1 whilst in Word, and search for "numeric picture field switch". If no number format is specified the value will be entered exactly as it appears in the IRIS database.

  4. Leave the Paste function field blank and click OK to enter the formula into your document.

You should have a formula similar to the following:

{ =A+B \# #,##0.00 }

 

  1. Delete the dummy sum A+B and replace it with the tags from the IRIS database you wish to perform arithmetic on (see the section on adding tags), using the + (plus),- (minus),/ (divide) and * (multiply) symbols as necessary.

    An example would be as follows:

{ = { MERGEFIELD "LMCLCYrBalLiab" }+{ MERGEFIELD "LMCLNYrOAC" } \# #,##0.00 }

 

The formatting of the tag will be reflected in the output. For example, if the tag is in a bold font, then the substituted information will also be produced in a bold font.

 

If only a single tag is specified after the = sign, then that value will be placed in the document, subject to the format specified by the \# switch.

 

Back to top


 

For earlier versions

The formula entry area will be underneath the two field selection panes.


If this is the case, follow these steps:

  1. Where the = sign is, type a dummy sum, for example, A+B immediately after it. If you do not require any custom formatting, then click OK to create the formula.

  2. If you want the number to be formatted differently, enter a space after the dummy sum then type \# and another space, then enter the numeric picture field you wish to format the number with. For example \# #,##0.00 will format the number with a comma separator for the thousands, and to two decimal places. For guidance on using number formats consult Microsoft Help by pressing F1 whilst in Word and searching for "numeric picture field switch".

  3. Click OK to enter the formula into your document.

You should have a formula similar to the following:

{ =A+B \# #,##0.00 }

 

  1. Delete the dummy sum A+B and replace it with the tags from the IRIS database you wish to perform arithmetic on (see the section on adding tags), using the + (plus),- (minus),/ (divide) and * (multiply) symbols as necessary. An example would be as follows:

{ = { MERGEFIELD "LMCLCYrBalLiab" }+{ MERGEFIELD "LMCLNYrOAC" } \# #,##0.00 }

 

The formatting of the tag will be reflected in the output. For example, if the tag is in a bold font, then the substituted information will also be produced in a bold font.

If only a single tag is specified after the = sign, then that value will be placed in the document, subject to the format specified by the \# switch.

 

Back to top