GUIDED API LAB
Loading lesson...
The coding workspace is preparing the first ApplicationFields exercise.
Execution profile
Selections—
Fields created—
Fields added—
Fields updated—
Fields removed—
Ready to tryUse the controls above to interact with this demo.
Server-side document API
Work with persistent document fields
ApplicationField represents typed, Word-compatible fields stored in the document. The collection exposes their type, parameters, visible text, name, and exact document range.
Field collection
ServerTextControl.ApplicationFields
Create a field
new ApplicationField(ApplicationFieldFormat.MSWord, typeName, text, parameters)
Insert at selection
ApplicationFieldCollection.Add
Remove or retain text
ApplicationFieldCollection.Remove(field, keepText)
How the lab executes code
Each lesson starts with three prepared fields: customer, invoice total, and due date. Submitted statements are parsed against an allowlist for field construction, collection access, field properties, insertion, and removal; arbitrary CLR source is never compiled.
The sample uses ApplicationFieldFormat.MSWord with MERGEFIELD, DATE, and IF instructions. Field parameters remain available for later mail merge or document processing, while Start and Length identify their positions in the document.
NuGet packages
TXTextControl.TextControl.Core.SDK
34.0.4
Provides the core document model and server-side document processing APIs.
dotnet add package TXTextControl.TextControl.Core.SDK --version 34.0.4