To view the details of the merge field tags, open the document and press 'Alt + F9'.
There are two things that influence how merged data is formatted in your template:
- The 'normal' Word formatting applied to the merge field tag. Formatting such as font settings applied to the merge field tag are applied to the merged data. For this to happen \*MERGEFORMAT needs to be included in the merge field tag (this is included by default if you add your merge field via the Insert Field dialogue box).
- Mergefield switches included in the merge field tag. These can be added via the Insert Field dialogue box (using the 'Field Options' on the right of the dialogue box or by clicking the 'Field Codes' button at the lower left of the dialogue box - The 'Options...' button that then appears will you to add the field code switches) or by editing the merge field tags directly (Press Alt F9 to see these).
Some common merge field switches:
Text formatting switches (Reference):
- \*CAPS First Letter Of Each Word Is Upper Case
- \*FIRSTCAPS First letter of first word upper case.
- \*UPPER All UPPER CASE
- \*LOWER all lower case
Switches for adding text around the merge field (Reference):
- \B "text" Display text or whatever is enclosed in the double quotes (" ") BEFORE the merged field IF the value is NOT empty
- \F "text" Display text or whatever is enclosed in the double quotes (" ") FOLLOWING the merged field IF the value is NOT empty
Note. The text in the double quotes can be any 'normal' text, even another MergeField. E.g. to optionally add a space use " " to optionally add a new line enter a carriage return (press the [enter] key) between the double quotes - this will display the merge field tag over 2 (or more lines) but Word interprets this as one tag. The size of the field in the merged document is determined by the size of the merged data, not the size of the merge field tag. Switches that apply a format 'picture' to the merged data. These switches with a common picture (picture is Microsoft's term for the format string within the double quotes (" ")) are:
- \@ "dd/MM/YYYY hh:mm AM/PM" Use \@ to format dates and/or times. This picture will display as 24/11/1974 10:21 AM (see HERE for more date-time picture items)
- \# "$,0.00;($,0.00);$ -" Use \# to format numeral data. This picture will display differently depending on the value; 1,234.56 will display $1,234.56, -213.1 will display ($213.10) and 0 will display $ - (see HERE for more numeral picture items)
- To suppress 0 values use a modification of this, there needs to be a space corresponding to the value you want to suppress. eg. \# "$,0.00;; " Note the spaces after the second ; This will suppress all zero values.
A Final Note: if you edit the data item of the merge field and then hide the details (Alt F9) the value between the chevrons (<< >>) will not change, but this can be edited separately. Likewise, editing the value between the chevrons does not change the data item associated to the merge field. If that is not enough and you want to read more this is a good reference.
Comments
0 comments
Please sign in to leave a comment.