TextInput (object)

<< Click to Display Table of Contents >>

TextInput (object)

Access paths:

Application à Documents à Item à FormFields à Item à TextInput

Application à ActiveDocument à FormFields à Item à TextInput

 1  Description

A TextInput object represents one individual form object of the type TextInput and allows you to retrieve and change its value.

A TextInput object can be any of the following object types:

a text field, created with the ribbon command Insert | Objects group | Form object | Text field;

a text frame, created with the ribbon command Insert | Objects group | Text frame; or

a drawing, to which text has been added using the Add text command.

TextInput is a child object of FormField.

 2  Access to the object

The TextInput object can be accessed solely through its parent object FormField.

Only if the property TextInput.Valid returns the value True, the form object really represents a text field – and not a check box or a drop-down list.

An example:

' Check the type of the first form object.

' If it is a TextInput object, output its text.

 

If tm.ActiveDocument.FormFields(1).TextInput.Valid Then

 MsgBox tm.ActiveDocument.FormFields(1).TextInput.Text

End If

 3  Properties, objects, collections and methods

Properties:

Text (default property)

Valid R/O

LockText

 

Objects:

Application Application

Parent FormField

Text (property)

Data type: String

Gets or sets the content of the text field.

Valid (property, R/O)

Data type: Boolean

Returns False if the object is not a TextInput object.

LockText (property)

Data type: Boolean

Gets or sets the setting "Lock text" of the text field (True or False). Corresponds to the "Locked" option on the Properties tab of the dialog box with the properties of an object.

Note that TextMaker locks the text field against text input only when form mode is active.

Application (pointer to object)

Data type: Object

Returns the Application object.

Parent (pointer to object)

Data type: Object

Returns the parent object, i.e. an object of the type FormField.