Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Reporting
  [Expand]Chart Control
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Getting Started
   [Collapse]Concepts
     ASPxRichEdit Control
    [Expand]Document
     Supported Document Formats
     Import and Export
     Formatting Characters
     Formatting Paragraphs
    [Collapse]Fields
     [Collapse]Field Codes
       DATE
       DOCVARIABLE
       HYPERLINK
       MERGEFIELD
       NUMPAGES
       PAGE
       TIME
     Mail Merge
     Restrictions
     Spell Checking
    [Expand]Client API
    [Expand]Built-in Dialogs
     Adaptivity
     HTML Tag Interpretation
     Keyboard Shortcuts
   [Expand]Examples
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gauges
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

MERGEFIELD

MERGEFIELD

MailMerge field

{ MERGEFIELD "field name" [ switch ] [\* MERGEFORMAT] }


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

  • The \* MERGEFORMAT switch retains the formatting applied to the field.

  • The \b "text" switch specifies the text to be inserted before the MERGEFIELD field if the field is not blank.

  • The \f "text" switch specifies 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:

    David Bradley

  • Otherwise, the MiddleName is separated by spaces as required:

    David M Bradley


Is this topic helpful?​​​​​​​