EditType Method

Applies To

TextInput object.

Description

Sets options for the specified text form field.

Syntax

expression.EditType(Type, Default, Format, Enabled)

expression Required. An expression that returns a TextInput object.

Type Required Long. The text box type. Can be one of the following WdTextFormFieldType constants: wdCalculationText, wdCurrentDateText, wdCurrentTimeText, wdDateText, wdNumberText, or wdRegularText.

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.

See Also

Default property, Result property.

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