TX Text Control .NET for Windows Forms

ApplicationFields Property

Property|Introduced in 14.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.Server.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets a collection of all Microsoft Word or Heiler HighEdit fields that have been created or imported from a Microsoft Word or RTF document. The property value is an object of the type ApplicationFieldCollection. Before loading a document the LoadSettings.ApplicationFieldFormat property must be set, otherwise this collection is empty. The collection contains the fields contained in the main text of the document.

Syntax

public ApplicationFieldCollection ApplicationFields { get; }

Examples

The following example updates the visible text of the CustomerName merge field.

foreach (ApplicationField field in textControl.ApplicationFields)
{
    if (field.TypeName == "MERGEFIELD" &&
        field.Parameters.Length > 0 &&
        field.Parameters[0] == "CustomerName")
    {
        field.Text = "Contoso Ltd.";
    }
}

Limitations

Runtime only.

Read only.

See Also

Text Fields and Hypertext Links - Hypertext Links.