ClearFormField

Syntax

ClearFormField

Remarks

Clears the text in a text form field selected in a protected form document. ClearFormField behaves like the BACKSPACE key. Note that in an unprotected form document, ClearFormField deletes the selected text form field.

Example

This example is intended to run when the focus moves to a text form field. If the user moves to the form field using the tab key, thereby selecting its contents, the condition GetSelStartPos() <> GetSelEndPos() is true and Word clears the form field. If the user clicks the form field with the mouse, the condition is false and Word takes no action.


If GetSelEndPos() <> GetSelStartPos() Then ClearFormField

See Also

SetFormResult, TextFormField