# How to Import and Read Form Fields from DOCX Documents in .NET on Linux

> Learn how to import and read form fields from DOCX documents in .NET on Linux using TX Text Control. This article provides a step-by-step guide to help you get started with form fields in TX Text Control.

- **Author:** Bjoern Meyer
- **Published:** 2025-05-19
- **Modified:** 2025-11-16
- **Description:** Learn how to import and read form fields from DOCX documents in .NET on Linux using TX Text Control. This article provides a step-by-step guide to help you get started with form fields in TX Text Control.
- **4 min read** (610 words)
- **Tags:**
  - ASP.NET
  - ASP.NET Core
  - Form Fields
  - DOCX
  - MS Word
- **LLMs.txt URL:** https://www.textcontrol.com/blog/2025/05/19/how-to-import-and-read-form-fields-from-docx-documents-in-net-on-linux/llms.txt
- **LLMs-full.txt URL:** https://www.textcontrol.com/blog/2025/05/19/how-to-import-and-read-form-fields-from-docx-documents-in-net-on-linux/llms-full.txt
- **Canonical URL:** https://www.textcontrol.com/blog/2025/05/19/how-to-import-and-read-form-fields-from-docx-documents-in-net-on-linux/

---

Microsoft Word form fields, such as content controls and legacy form fields, are widely used to create interactive documents for data entry, templates, and workflows. Users can input structured data directly within Word documents with these fields, which are commonly used in contract automation, surveys, and forms.

Building cross-platform .NET applications can be challenging, especially when working with form fields, especially on Linux systems. Fortunately, TX Text Control provides a powerful, consistent API that allows you to import, access, and manipulate both content controls (structured document tags) and legacy form fields in DOCX documents across platforms, including Linux.

### What Are MS Word Form Fields?

Microsoft Word supports two main types of form fields:

- **Legacy Form Fields:** These are the basic fields used in older versions of Word, such as text inputs, checkboxes, and dropdowns.
- **Content Controls:** These were introduced in later versions of Word and offer a more structured, XML-based approach to embedding data in documents.

TX Text Control provides seamless support for both formats through a unified API, making it easy to programmatically create, read, and manipulate form fields in your .NET applications.

### How to Work with Form Fields in TX Text Control

When loading a document, the ApplicationFieldFormat property can be used for specification of how a field is imported. Three relevant options can be specified when importing fields.

- **None:**Text fields supported by other applications are not imported as ApplicationFields. Form fields are imported as TX Text Control FormFields.
- **MSWord:**Fields that are supported and defined by Microsoft Word are imported as ApplicationFields. The ApplicationFieldTypeNames property can be used to select specific types of fields.
- **MSWordTXFormFields:**Fields that are supported and defined by Microsoft Word are imported as ApplicationFields, with the exception of form fields. Form fields such as combo boxes, check boxes, and form text fields are imported as TX Text Control FormField.

By using **MSWordTXFormFields**, all legacy and content control form fields are automatically converted into TX Text Control form fields.

Now, let's take a look at a document that contains both content control form fields and older, legacy form fields.

![DOCX (Office Open XML) form fields in TX Text Control](https://s1-www.textcontrol.com/assets/dist/blog/2025/05/19/a/assets/formfields.webp "DOCX (Office Open XML) form fields in TX Text Control")

### Accessing Form Fields

Looping through all fields is simple. We just need to load the document with the specific LoadSettings and access the FormFieldCollection.

```
using TXTextControl;

var loadSettings = new LoadSettings
{
ApplicationFieldFormat = ApplicationFieldFormat.MSWordTXFormFields
};

using var serverTextControl = new ServerTextControl();
serverTextControl.Create();
serverTextControl.Load("document.docx", StreamType.WordprocessingML, loadSettings);

Console.WriteLine("Form Fields in the document:");

foreach (var field in serverTextControl.FormFields)
{
switch (field)
{
case TextFormField textField:
Console.WriteLine($"TextFormField: {textField.Text}");
break;

case CheckFormField checkBox:
Console.WriteLine($"CheckFormField: {checkBox.Checked}");
break;

case DateFormField dateField:
Console.WriteLine($"DateFormField: {dateField.Date}");
break;

case SelectionFormField selectionField:
var selectedItem = selectionField.Items.ElementAtOrDefault(selectionField.SelectedIndex);
Console.WriteLine($"SelectionFormField: {selectedItem}");
break;
}
}
```

In this example, we load a DOCX document that contains both content control form fields and legacy form fields. The document is loaded with the **MSWordTXFormFields** setting, which converts all form fields into TX Text Control form fields.

The following results are printed to the console:

```
Form Fields in the document:
TextFormField: Content Control Text

CheckFormField: True
SelectionFormField: Item2
DateFormField: 5/8/2025 12:00:00 AM
TextFormField: Text1
CheckFormField: False
```

Both form field types are accessible in the unified form field provided by the TX Text Control.

### Conclusion

TX Text Control provides a powerful API for working with form fields in .NET applications, regardless of the platform. By using the **MSWordTXFormFields** setting, you can easily convert and access both content control and legacy form fields in your documents.

---

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

- [How to Programmatically Create MS Word DOCX Documents with .NET C# on Linux](https://www.textcontrol.com/blog/2025/04/10/how-to-programmatically-create-ms-word-docx-documents-with-dotnet-csharp-on-linux/llms.txt)
- [Edit MS Word DOCX Files in .NET C# and ASP.NET Core](https://www.textcontrol.com/blog/2025/01/24/edit-ms-word-docx-files-in-net-c-sharp-and-asp-net-core/llms.txt)
- [Create Word Document with .NET C#](https://www.textcontrol.com/blog/2024/10/25/create-word-document-with-net-c-sharp/llms.txt)
- [From Legacy Microsoft Office Automation to a Future-Ready Document Pipeline with C# .NET](https://www.textcontrol.com/blog/2026/03/02/from-legacy-microsoft-office-automation-to-a-future-ready-document-pipeline-with-csharp-dot-net/llms.txt)
- [How to Extend the Default Style Mapping when Converting DOCX to Markdown in .NET C#](https://www.textcontrol.com/blog/2025/12/22/how-to-extend-the-default-style-mapping-when-converting-docx-to-markdown-in-dotnet-csharp/llms.txt)
- [DOCX Meets Markdown: Preparing Enterprise Documents for AI](https://www.textcontrol.com/blog/2025/09/19/docx-meets-markdown-preparing-enterprise-documents-for-ai/llms.txt)
- [Converting MS Word (*.docx) to Markdown (*.md) in .NET C#](https://www.textcontrol.com/blog/2025/09/19/converting-ms-word-docx-to-markdown-md-in-dotnet-csharp/llms.txt)
- [From DOCX to Long-Term Archiving: Generating PDF/A from Office Documents in .NET C#](https://www.textcontrol.com/blog/2025/09/04/from-docx-to-long-term-archiving-generating-pdfa-from-office-documents-in-dotnet-csharp/llms.txt)
- [Why HTML is not a Substitute for Page-Oriented Formats like DOCX](https://www.textcontrol.com/blog/2025/08/19/why-html-is-not-a-substitute-for-page-oriented-formats-like-docx/llms.txt)
- [Convert MS Word DOCX to PDF including Text Reflow using .NET C# on Linux](https://www.textcontrol.com/blog/2025/06/10/convert-ms-word-docx-to-pdf-including-text-reflow-using-dotnet-csharp-on-linux/llms.txt)
- [Use MailMerge in .NET on Linux to Generate Pixel-Perfect PDFs from DOCX Templates](https://www.textcontrol.com/blog/2025/05/27/use-mailmerge-in-dotnet-on-linux-to-generate-pixel-perfect-pdfs-from-docx-templates/llms.txt)
- [Convert Plain Text to Bulleted Lists in C# with .NET](https://www.textcontrol.com/blog/2025/01/21/convert-plain-text-to-bulleted-lists-in-csharp-with-dotnet/llms.txt)
- [Extracting Comments from DOCX Files in .NET C#](https://www.textcontrol.com/blog/2025/01/17/extracting-comments-from-docx-files-in-net-csharp/llms.txt)
- [Convert MS Word DOCX to SVG in .NET C#](https://www.textcontrol.com/blog/2024/12/30/convert-ms-word-docx-to-svg-in-net-csharp/llms.txt)
- [Create Fillable PDF Forms in .NET C#](https://www.textcontrol.com/blog/2024/11/12/create-fillable-pdf-forms-in-net-c-sharp/llms.txt)
- [Sign Documents with a Self-Signed Digital ID From Adobe Acrobat Reader in .NET C#](https://www.textcontrol.com/blog/2024/08/12/sign-documents-with-a-self-signed-digital-id-from-adobe-acrobat-reader-in-net-c-sharp/llms.txt)
- [Extension Method: Flatten Forms Fields in PDF Documents using .NET C#](https://www.textcontrol.com/blog/2024/07/17/flatten-forms-fields-in-pdf-documents-using-net-c-sharp/llms.txt)
- [Working with Content Controls in MS Word Documents using TX Text Control in C#](https://www.textcontrol.com/blog/2024/03/04/working-with-content-controls-in-ms-word-documents-using-tx-text-control-in-c-sharp/llms.txt)
- [Converting MS Word DOCX Documents to PDF in C#](https://www.textcontrol.com/blog/2023/10/16/converting-ms-word-docx-documents-to-pdf-in-csharp/llms.txt)
