[Table of Contents] [docx version]

WordprocessingML Reference Material - Table of Contents

MERGEFIELD

Syntax:

MERGEFIELD field-argument [ switch ]

Description: Retrieves the name of a data field designated by text in field-argument within the merge characters in a mail merge main document. When the main document is merged with the selected data source, information from the specified data field is inserted in place of the merge field.

The name designated by text shall match exactly the field name in the header record.

Field Value: The name of a data field designated by text in field-argument.

Switches: Zero or more of the following field-specific-switches.

\b field-argument

The text in this switch's field-argument specifies the text to be inserted before the MERGEFIELD field if the field is not blank.

\f field-argument

The text in this switch's field-argument specifies the text to be inserted after the MERGEFIELD field if the field is not blank.

\m

Specifies that the MERGEFIELD field is a mapped field.

\v

Enables character conversion for vertical formatting.

 

[Example: Placing the following three MERGEFIELD fields together and using the \f switch ensures that the three fields have spaces between them, but only if the designated field information is present in the data source.

MERGEFIELD CoutesyTitle \f " " MERGEFIELD FirstName \f " "
MERGEFIELD LastName

end example]