TX Text Control .NET for WPF

MergeField Class

Class|Introduced in 15.0
Namespace
TXTextControl.DocumentServer.Fields
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXDocumentServer.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXDocumentServer.dll from the setup.
Inherits
  1. FieldAdapter
  2. MailMergeFieldAdapter
  3. MergeField

Description

The MergeField class implements the MS Word specific MERGEFIELD field. This field must be used in combination with an ApplicationField that should be modified using this adapter.

Syntax

public sealed class MergeField : MailMergeFieldAdapter

Examples

The following example creates a Merge Field instance and configures its name setting for a document workflow.

TXTextControl.DocumentServer.Fields.MergeField mergeField = new();
mergeField.Name = "MergeField1";

Members

Constructors

ConstructorDescription
MailMergeFieldAdapterInitializes a new instance of the MailMergeFieldAdapter class. (Inherited from MailMergeFieldAdapter.)
MergeFieldInitializes a new instance of the MergeField class.

Properties

PropertyDescription
DataSourceCultureSpecifies the culture with which numerical and date / time values coming from the data source are parsed. The default value for this property is the current thread culture.
DateTimeFormatSpecifies a string format which is applied to date / time values. Is equivalent to the MS Word field flag “\@”.
MappedSpecifies whether the field is a mapped field.
MergeCultureSpecifies the culture with which numerical and date / time values are formatted when merged into the target document. The default value for this property is the current thread culture.
NameGets and sets the name of the field.
NumericFormatSpecifies a string format which is applied to numeric values. Is equivalent to the MS Word field flag “\#”.
PreserveFormattingSpecifies whether the field's formatting should be preserved. (Inherited from MailMergeFieldAdapter.)
TextGets and sets the text of the field.
TextAfterGets and sets the text of the field that is displayed after the field's text.
TextBeforeGets and sets the text of the field that is displayed before the field's text.
TextFormatGets and sets the text format of the field.
VerticalFormattingSpecifies whether the field's formatting is vertical.

Fields

FieldDescription
TYPE_NAMENot described in the reference. public const string TYPE_NAME = "MERGEFIELD";

Further Reading

  • Mail Merge with an MS SQL Server Database –
  • How to Use the FieldAdapter Classes to Manipulate ApplicationFields –