MaxLength Property (Page Object Model)

Returns or sets a Long that represents the maximum number of characters that a user can enter into an input control.

expression.MaxLength

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Remarks

The maxLength property limits the number of characters a user can enter into a text box and has a default value of no limit.

Example

The following example specifies the maximum number of characters for the first INPUT element in the active document. This assumes that there is at least one INPUT element in the active document and that the first INPUT element is a text box.

Dim objInput As FPHTMLInputTextElement
Set objInput = ActiveDocument.all.tags("input").Item(0)
    
objInput.MaxLength = 50

Applies to | FPHTMLInputFileElement Object | FPHTMLInputTextElement Object | IHTMLInputFileElement Object | IHTMLInputTextElement Object