# MailMergeFieldAdapter Constructor

> Initializes a new instance of the MailMergeFieldAdapter class.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Constructor
- **Introduced:** 15.0
- **Namespace:** `TXTextControl.DocumentServer.Fields`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXDocumentServer.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.DocumentServer.Fields > MailMergeFieldAdapter Constructor
- **506 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-fields/mailmergefieldadapter/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-fields/mailmergefieldadapter/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-fields/mailmergefieldadapter/constructor/llms-full.txt

---

### Description

Initializes a new instance of the MailMergeFieldAdapter class.

### Syntax

#### MailMergeFieldAdapter()

Initializes a complete new instance of the MailMergeFieldAdapter class without a connection to an existing ApplicationField.

```csharp
public MailMergeFieldAdapter();
```

```vbnet
Public Sub New()
```

#### MailMergeFieldAdapter(ApplicationField)

Initializes a new instance of the MailMergeFieldAdapter class with a connection to an existing ApplicationField.

```csharp
public MailMergeFieldAdapter(ApplicationField appField);
```

```vbnet
Public Sub New(appField As ApplicationField)
```

| Parameter | Description |
|---|---|
| appField | Specifies the to-be-adapted ApplicationField. |

### Examples

The following example includes the preserve formatting value from a Mail Merge Field Adapter object in application diagnostics. The created object is then available to the surrounding document workflow.

```csharp
Console.WriteLine($"Preserve Formatting: {mailMergeFieldAdapter.PreserveFormatting}");
Console.WriteLine("Mail Merge Field Adapter is ready for use.");
```

```vbnet
Console.WriteLine($"Preserve Formatting: {mailMergeFieldAdapter.PreserveFormatting}")
Console.WriteLine("Mail Merge Field Adapter is ready for use.")
```

---

## Nearby

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