Back to Devexpress

MERGEFIELD

wpf-10303-controls-and-libraries-rich-text-editor-fields-field-codes-mergefield.md

latest2.3 KB
Original Source

MERGEFIELD

  • Jun 18, 2024
  • 2 minutes to read

MailMerge field

{ MERGEFIELD “field name“ [switch] [* MERGEFORMAT] }

When the main document is merged with a selected data source, information from the specified data field is inserted in place of the merge field.

The MERGEFIELD field supports the following switches:

SwitchDescription
* MERGEFORMATRetains the formatting applied to the field.
\b “textSpecifies the text to be inserted before the MERGEFIELD field if the field is not blank.
\f “textSpecifies the text to be inserted after the MERGEFIELD field if the field is not blank.

Example:

{ MERGEFIELD FirstName \f” “ }{ MERGEFIELD MiddleName \f” “ }{ MERGEFIELD LastName }

  • If the MiddleName field data is missing (null), then there is only one space between FirstName and LastName:

  • Otherwise, MiddleName is separated by spaces as required:

If the merge field is replaced with a DateTime value and no formatting switch is specified, the actual display formatting is dependent on the DXRichEditFieldOptions.UseCurrentCultureDateTimeFormat option.

Click the Show All Field Results button on the Mail Merge ribbon tab to display the MERGEFIELD field as a placeholder.

Click the View Merged Data button on the Mail Merge ribbon tab to display the MERGEFIELD code result.