TX Text Control .NET Server

TypeName Property

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

Description

Gets or sets the field's type name. For example for the type name of a Microsoft Word MergeField is MERGEFIELD. If the type name of the field is changed, its parameters must also be changed.

Syntax

public string TypeName { get; set; }

Examples

The following example inserts and configures a Word-compatible mail-merge field by using ApplicationField.TypeName.

textControl.Text = "Dear Customer";
textControl.InputPosition = new InputPosition(5);
ApplicationField applicationField = new(ApplicationFieldFormat.MSWord, "MERGEFIELD", "Customer", new[] { "CustomerName" });
textControl.ApplicationFields.Add(applicationField);

applicationField.TypeName = "MERGEFIELD";
if (!string.IsNullOrWhiteSpace(applicationField.TypeName))
{
    Console.WriteLine($"Type Name: {applicationField.TypeName}");
}