# ApplicationField Object

> The ApplicationField object supports text field formats of applications such as Microsoft Word. The object only provides an interface to retrieve and change the data and parameters of such fields. The field logic itself is not implemented. Currently supported applications and components are Microsoft Word and Heiler HeighEdit.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > ApplicationField Object
- **2450 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/llms-full.txt

---

### Description

The ApplicationField object supports text field formats of applications such as Microsoft Word. The object only provides an interface to retrieve and change the data and parameters of such fields. The field logic itself is not implemented. Currently supported applications and components are Microsoft Word and Heiler HeighEdit.

### Syntax

```javascript
ApplicationField
```

### Examples

The following example demonstrates `ApplicationField` in a practical document-editing workflow. The ApplicationField object supports text field formats of applications such as Microsoft Word. The object only provides an interface to retrieve and change the data and parameters of such fields. The field logic itself is not implemented. Currently supported applications and components are Microsoft Word and Heiler HeighEdit.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.textParts.getMainText(function(mainText) {
    const applicationFields = mainText.applicationFields;
    applicationFields.getItem(function(applicationField) {
        if (!applicationField) {
            console.warn("No application field is available at the current input position.");
            return;
        }
    
        applicationField.getFormat(
            function(result) {
                console.log("get format result:", result);
            },
            onTxError
        );
    }, onTxError);
}, onTxError);
```

---

## In This Section

- [Javascript: ApplicationField.getFormat Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/getformat-method/llms-full.txt): Gets the field's format.
- [Javascript: ApplicationField.getParameters Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/getparameters-method/llms-full.txt): Gets the field' 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. The string MERGEFIELD is the type name of the field and can be obtained through getTypeName. If a field has no parameters, this array is null.
- [Javascript: ApplicationField.getTypeName Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/gettypename-method/llms-full.txt): Gets the field's type name. The type name of a Microsoft Word MergeField is MERGEFIELD, for example. If the type name of the field is changed, its parameters must also be changed.
- [Javascript: ApplicationField.setFormat Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/setformat-method/llms-full.txt): Sets the field's format.
- [Javascript: ApplicationField.setParameters Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/setparameters-method/llms-full.txt): Sets the field's parameters.
- [Javascript: ApplicationField.setTypeName Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/settypename-method/llms-full.txt): Sets the field's type name. The type name of a Microsoft Word MergeField is MERGEFIELD, for example. If the type name of the field is changed, its parameters must also be changed.

---

## Nearby

- **Previous:** [AddSubTextPartCallback Function](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/addsubtextpartcallback/llms-full.txt)
- **Next:** [Javascript: ApplicationField.getFormat Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/applicationfield/getformat-method/llms-full.txt)
