Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sets options for the specified text form field.
Syntax
expression. EditType( _Type_ , _Default_ , _Format_ , _Enabled_ )
expression Required. A variable that represents a 'TextInput' object.
Parameters
| Name | Required/Optional | Data type | Description |
|---|---|---|---|
| Type | Required | WdTextFormFieldType | The text box type. |
| Default | Optional | Variant | The default text that appears in the text box. |
| Format | Optional | Variant | The formatting string used to format the text, number, or date (for example, "0.00," "Title Case," or "M/d/yy"). For more examples of formats, see the list of formats for the specified text form field type in the Text Form Field Options dialog box. |
| Enabled | Optional | Variant | True to enable the form field for text entry. |
Example
This example adds a text form field named "Today" at the beginning of the active document. The EditType method is used to set the type to wdCurrentDateText and set the date format to "M/d/yy."
With ActiveDocument.FormFields.Add _
(Range:=ActiveDocument.Range(0, 0), _
Type:=wdFieldFormTextInput)
.Name = "Today"
.TextInput.EditType Type:=wdCurrentDateText, _
Format:="M/d/yy", Enabled:=False
End With
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.