Implementing a FORMTEXT Class

The FormText field is used in MS Word to create fillable documents. In many applications, such documents are automated, so that these fields must be readable to be completed automatically. An ApplicationField object acts like a container for all settings (switches) of these fields.

This sample uses the DocumentServer.Fields.FormText field adapter to handle the ApplicationField. Everytime, an ApplicationField of type FORMTEXT should be edited, a new DocumentServer.Fields.FormText field is created:

[C#]
FormText curFormText = new FormText(textControl1.ApplicationFields.GetItem());
[Visual Basic]
Dim curFormText As New FormText(TextControl1.ApplicationFields.GetItem())

A reference to the ApplicationField is stored in the FormText instance. Similar to the first sample, this ApplicationField is used to get or set the parameters that are mapped to the properties of the new implemented FormText object.

A dialog box is implemented to change the properties of the specific form text field. The dialog represents the properties of the implemented FormText field:

After clicking OK, the specified values in the dialog box are set in the implemented FormText object which writes the parameters of the referenced ApplicationField automatically.

<< Previous Next >>