# ApplicationField Constructor

> Initializes a new instance of the ApplicationField class. The format of the parameters depends on the application that supports the field. The field is initialized without syntax check.

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

---

### Description

Initializes a new instance of the ApplicationField class. The format of the parameters depends on the application that supports the field. The field is initialized without syntax check.

### Syntax

```csharp
public ApplicationField(ApplicationFieldFormat format, string typeName, string text, string[] parameters);
```

```vbnet
Public Sub New(format As ApplicationFieldFormat, typeName As String, text As String, parameters As String())
```

### Parameters

| Parameter | Description |
|---|---|
| format | Specifies the format of the field. The format depends on the application that supports the field. It can be `ApplicationFieldFormat.MSWord` or `ApplicationFieldFormat.HighEdit`. |
| typeName | Specifies the type name of the field. For example the type name of a Microsoft Word MergeField is MERGEFIELD. |
| text | Specifies the visible text of the field. |
| parameters | Specifies an array of strings which are the field's parameters. The order and format of the strings depend on the field's format. For example a Microsoft Word MergeField has the following format: MERGEFIELD FieldName \[switches\]. In this case the first string of the array is the FieldName and the following strings are possible switches. If a field has no parameters, null can be specified. |

### Examples

The following example inserts and configures a Word-compatible mail-merge field.

```csharp
textControl.Text = "Dear Customer";
textControl.InputPosition = new InputPosition(5);
ApplicationField applicationField = new(ApplicationFieldFormat.MSWord, "MERGEFIELD", "Customer", new[] { "CustomerName" });
textControl.ApplicationFields.Add(applicationField);
```

```vbnet
textControl.Text = "Dear Customer"
textControl.InputPosition = New InputPosition(5)
Dim applicationField As New ApplicationField(ApplicationFieldFormat.MSWord, "MERGEFIELD", "Customer", New String() { "CustomerName" })
textControl.ApplicationFields.Add(applicationField)
```

---

## Nearby

- **Previous:** [ApplicationField Class](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/applicationfield/llms-full.txt)
- **Next:** [ApplicationField.Format Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/applicationfield/format-property/llms-full.txt)
