TextInput.EditType Method

Word Developer Reference

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."

Visual Basic for Applications
  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