TX Text Control .NET for Windows Forms

ApplicationFields Property

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

Description

Gets a collection of all application fields contained in the text part with the input focus. This can be the main text, a text frame or a header or footer. Application fields are 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 of the text part with the input focus. This can be the main text, a text frame or a header or footer.

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.

Further Reading

  • Using IFormattedText Objects to Access Elements Across All TextParts in a Document –