# MergeField Class

> 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.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 15.0
- **Namespace:** `TXTextControl.DocumentServer.Fields`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Inherits:** `TXTextControl.DocumentServer.Fields.FieldAdapter` › `TXTextControl.DocumentServer.Fields.MailMergeFieldAdapter`
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.DocumentServer.Fields > MergeField Class
- **1289 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/llms-full.txt

---

### Description

The MergeField class implements the MS Word specific MERGEFIELD field. This field must be used in combination with an [ApplicationField](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/applicationfield/llms-full.txt) that should be modified using this adapter.

### Syntax

```csharp
public sealed class MergeField : MailMergeFieldAdapter
```

```vbnet
Public NotInheritable Class MergeField
    Inherits MailMergeFieldAdapter
```

### Examples

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

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

```vbnet
Dim mergeField As New TXTextControl.DocumentServer.Fields.MergeField()
mergeField.Name = "MergeField1"
```

---

## In This Section

- [MergeField Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/constructor/llms-full.txt): Initializes a new instance of the MergeField class.
- [MergeField.DataSourceCulture Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/datasourceculture-property/llms-full.txt): Specifies 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.
- [MergeField.DateTimeFormat Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/datetimeformat-property/llms-full.txt): Specifies a string format which is applied to date / time values. Is equivalent to the MS Word field flag “\@”.
- [MergeField.Mapped Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/mapped-property/llms-full.txt): Specifies whether the field is a mapped field.
- [MergeField.MergeCulture Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/mergeculture-property/llms-full.txt): Specifies 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.
- [MergeField.Name Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/name-property/llms-full.txt): Gets and sets the name of the field.
- [MergeField.NumericFormat Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/numericformat-property/llms-full.txt): Specifies a string format which is applied to numeric values. Is equivalent to the MS Word field flag “\#”.
- [MergeField.Text Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/text-property/llms-full.txt): Gets and sets the text of the field.
- [MergeField.TextAfter Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/textafter-property/llms-full.txt): Gets and sets the text of the field that is displayed after the field's text.
- [MergeField.TextBefore Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/textbefore-property/llms-full.txt): Gets and sets the text of the field that is displayed before the field's text.
- [MergeField.TextFormat Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/textformat-property/llms-full.txt): Gets and sets the text format of the field.
- [MergeField.VerticalFormatting Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/verticalformatting-property/llms-full.txt): Specifies whether the field's formatting is vertical.

---

## Nearby

- **Previous:** [MailMergeFieldAdapter.PreserveFormatting Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mailmergefieldadapter/preserveformatting-property/llms-full.txt)
- **Next:** [MergeField Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-fields/mergefield/constructor/llms-full.txt)
