# How to Use the FieldAdapter Classes to Manipulate ApplicationFields

> TX Text Control 15.0 introduced FieldAdapter classes that wrap ApplicationFields such as MergeField, DateField, IfField, and form controls with named properties. Developers create and edit MS Word-compatible fields without manually parsing raw parameter arrays or field switch strings.

- **Author:** Bjoern Meyer
- **Published:** 2009-10-21
- **Modified:** 2026-03-05
- **Description:** TX Text Control 15.0 introduced FieldAdapter classes that wrap ApplicationFields such as MergeField, DateField, IfField, and form controls with named properties. Developers create and edit MS Word-compatible fields without manually parsing raw parameter arrays or field switch strings.
- **3 min read** (437 words)
- **Tags:**
  - Fields
  - .NET
- **Web URL:** https://www.textcontrol.com/blog/2009/10/21/how-to-use-the-fieldadapter-classes-to-manipulate-applicationfields/
- **LLMs URL:** https://www.textcontrol.com/blog/2009/10/21/how-to-use-the-fieldadapter-classes-to-manipulate-applicationfields/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2009/10/21/how-to-use-the-fieldadapter-classes-to-manipulate-applicationfields/llms-full.txt

---

TX Text Control .NET for Windows Forms 14.0 introduced the [ApplicationField](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.applicationfield.class.htm) class to manipulate MS Word standard fields like *MergeField*, *Date* or *NumPages*. All switches and parameters of these fields are represented by the [Parameters](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.applicationfield.parameters.property.htm) property which gets or sets a string array of the available values.

In order to create or edit such fields, you need to know the structure of these standard fields. In version 15.0, we introduced the [FieldAdapter](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.documentserver.fields.fieldadapter.class.htm) classes for the most commonly used fields:

- MergeField
- DateField
- IfField
- IncludeText
- FormCheckbox
- FormDropDown
- FormText

These adapter classes can be used to create or manipulate these MS Word compatible fields without learning the specific switches and possible parameters. All settings can be easily accessed using the available properties.

Let's have a look at a typical MergeField:

```
{MERGEFIELD company \* Upper \b "Company:" \* MERGEFORMAT}
```

The following illustration shows this field in MS Word with a description of each parameter:

![Merge fields in MS Word](https://s1-www.textcontrol.com/assets/dist/blog/2009/10/21/a/assets/blog_adapterfields_word.webp "Merge fields in MS Word")By accesssing this field using the ApplicationFields, the *Parameter* property would return this string array:

```
{ "company", "\* Upper", "\b \"Company\"", "\* MERGEFORMAT" }
```

How does the FieldAdapter comes into play?

As the name implies, FieldAdapter is an adapter for the ApplicationFields. It can be only used in combination with these fields. To manipulate a MergeField, the [MergeField](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.documentserver.fields.mergefield.class.htm) adapter should be used. To create a new instance of the MergeField, the specific ApplicationField can be passed in the constructor:

```
foreach (TXTextControl.ApplicationField field in textControl1.ApplicationFields)
{
    if(field.TypeName == "MERGEFIELD")
    {
        TXTextControl.DocumentServer.Fields.MergeField mergeField =
            new TXTextControl.DocumentServer.Fields.MergeField(field);
        mergeField.Name = "companyname";
    }
}
```

In the above code, we check the *TypeName* of the field. If it is a MergeField, a new instance of the adapter class is created and the ApplicationField is passed in the constructor. After that, we have access to the specific MergeField properties like the *Name*. You can use the FieldAdapter to insert new fields as well:

```
TXTextControl.DocumentServer.Fields.MergeField mergeField =
        new TXTextControl.DocumentServer.Fields.MergeField();
    textControl1.ApplicationFields.Add(mergeField.ApplicationField);
```

Summary: Using the FieldAdapters, you can easily handle the most commonly used fields of MS Word. You don't need to care about parsing the parameters on your own. You get a full set of properties for each available setting.

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [Getting Started: ServerTextControl and MailMerge in a .NET 8 Console Application on Linux with Docker and WSL](https://www.textcontrol.com/blog/2025/03/12/getting-started-servertextcontrol-and-mailmerge-in-a-net-8-console-application-on-linux-with-docker-and-wsl/llms.txt)
- [Create a Table of Contents in Windows Forms using C#](https://www.textcontrol.com/blog/2023/01/23/create-toc-in-windows-forms/llms.txt)
- [Two Ways to Restart Numbered Lists in TX Text Control](https://www.textcontrol.com/blog/2021/11/03/two-ways-to-restart-numbered-lists/llms.txt)
- [Inserting MS Word Compatible FORMCHECKBOX Fields](https://www.textcontrol.com/blog/2010/01/27/inserting-ms-word-compatible-formcheckbox-fields/llms.txt)
- [Inserting and Processing MS Word Compatible DATE Fields](https://www.textcontrol.com/blog/2010/01/25/inserting-and-processing-ms-word-compatible-date-fields/llms.txt)
- [TX Text Control Smart-Tags: Connecting the Controls with Ease](https://www.textcontrol.com/blog/2009/10/16/tx-text-control-smart-tags-connecting-the-controls-with-ease/llms.txt)
- [.NET Licensing: How to Use the Licenses.licx File?](https://www.textcontrol.com/blog/2009/10/15/net-licensing-how-to-use-the-licenseslicx-file/llms.txt)
- [Paste Special: The Easy Way to Implement](https://www.textcontrol.com/blog/2009/09/07/paste-special-the-easy-way-to-implement/llms.txt)
- [Using TX Text Control Within a WCF Service Library](https://www.textcontrol.com/blog/2009/07/24/using-tx-text-control-within-a-wcf-service-library/llms.txt)
- [How to Remove All Section Breaks in a Document?](https://www.textcontrol.com/blog/2009/05/14/how-to-remove-all-section-breaks-in-a-document/llms.txt)
- [Batch Printing: How to Print Documents in One Print Job](https://www.textcontrol.com/blog/2009/03/20/batch-printing-how-to-print-documents-in-one-print-job/llms.txt)
- [Removing TextFields in a Loop](https://www.textcontrol.com/blog/2009/03/12/removing-textfields-in-a-loop/llms.txt)
- [TX Text Control RapidSpell .NET for Windows Forms Released](https://www.textcontrol.com/blog/2009/03/11/tx-text-control-rapidspell-net-for-windows-forms-released/llms.txt)
- [Table Indent Alignment Sample Available](https://www.textcontrol.com/blog/2009/02/26/table-indent-alignment-sample-available/llms.txt)
- [Creating a Table of Contents (TOC) Using TX Text Control](https://www.textcontrol.com/blog/2009/02/02/creating-a-table-of-contents-toc-using-tx-text-control/llms.txt)
- [Rendering TX Text Control's Content to a DataGridViewCell](https://www.textcontrol.com/blog/2009/01/20/rendering-tx-text-controls-content-to-a-datagridviewcell/llms.txt)
- [Revised Sample: Converting Text to a Table](https://www.textcontrol.com/blog/2009/01/07/revised-sample-converting-text-to-a-table/llms.txt)
- [TX Text Control Format Painter Sample Released](https://www.textcontrol.com/blog/2008/11/26/tx-text-control-format-painter-sample-released/llms.txt)
- [Strong Name Your Language Resource Files](https://www.textcontrol.com/blog/2008/11/21/strong-name-your-language-resource-files/llms.txt)
- [Chinese Resources for TX Text Control .NET for Windows Forms 14.0](https://www.textcontrol.com/blog/2008/10/28/chinese-resources-for-tx-text-control-net-for-windows-forms-140/llms.txt)
- [WYSIWYG Editing in Mozilla Firefox](https://www.textcontrol.com/blog/2008/10/20/wysiwyg-editing-in-mozilla-firefox/llms.txt)
- [The Imaging Source Announces Its PDF/A Activities](https://www.textcontrol.com/blog/2008/10/10/the-imaging-source-announces-its-pdfa-activities/llms.txt)
- [New Sample: Printing to Different Paper Trays](https://www.textcontrol.com/blog/2008/10/08/new-sample-printing-to-different-paper-trays/llms.txt)
- [TX Text Control .NET for Windows Forms Help and Support Center](https://www.textcontrol.com/blog/2008/09/30/tx-text-control-net-for-windows-forms-help-and-support-center/llms.txt)
- [New Tutorial Videos Released](https://www.textcontrol.com/blog/2008/09/08/new-tutorial-videos-released/llms.txt)
