FormField Object

Multiple objects
Multiple objects

Represents a single form field. The FormField object is a member of the FormFields collection.

Using the FormField Object

Use FormFields(index), where index is a bookmark name or index number, to return a single FormField object. The following example sets the result of the Text1 form field to "Don Funk."

ActiveDocument.FormFields("Text1").Result = "Don Funk"

The index number represents the position of the form field in the selection, range, or document. The following example displays the name of the first form field in the selection.

If Selection.FormFields.Count >= 1 Then
    MsgBox Selection.FormFields(1).Name
End If

Use the Add method with the FormFields object to add a form field. The following example adds a check box at the beginning of the active document and then selects the check box.

Set ffield = ActiveDocument.FormFields.Add( _
    Range:=ActiveDocument.Range(Start:=0, End:=0), _
ffield.CheckBox.Value = True


Use the CheckBox , DropDown , and TextInput properties with the FormField object to return the CheckDown, DropDown, and TextInput objects. The following example selects the check box named "Check1."

ActiveDocument.FormFields("Check1").CheckBox.Value = True

Properties | Application Property | CalculateOnExit Property | CheckBox Property | Creator Property | DropDown Property | Enabled Property | EntryMacro Property | ExitMacro Property | HelpText Property | Name Property | Next Property | OwnHelp Property | OwnStatus Property | Parent Property | Previous Property | Range Property | Result Property | StatusText Property | TextInput Property | Type Property

Methods | Copy Method | Cut Method | Delete Method | Select Method

Parent Objects | Document | Range | Selection

Child Objects | CheckBox | DropDown | FormField | Range | TextInput