Clear Method
Applies To
DropCap object, KeyBinding object, ListEntries collection object, TabStop object, TextInput object.
Description
DropCap object: Removes the dropped capital letter formatting.
KeyBinding object: Removes the key binding from the KeyBindings collection and resets a built-in command to its default key assignment.
ListEntries object: Removes all items from a drop-down form field.
TabStop object: Removes the specified custom tab stop.
TextInput object: Deletes the text from the specified text form field.
Syntax
expression.Clear
expression Required. An expression that returns a DropCap, KeyBinding, ListEntries, TabStop, or TextInput object.
See Also
ClearAll method, Delete method, Disable method.
Example
This example clears the first custom tab in the first paragraph of the active document.
ActiveDocument.Paragraphs(1).TabStops(1).Clear
This example protects the document for forms and deletes the text from the first form field if the field is a text form field.
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
If ActiveDocument.FormFields(1).Type = wdFieldFormTextInput Then
ActiveDocument.FormFields(1).TextInput.Clear
End If
This example removes all items from the form field named "Colors" in Sales.doc.
Documents("Sales.doc").FormFields("Colors").DropDown.ListEntries.Clear
This example removes dropped capital letter formatting from the first letter in the active document.
Set drop = ActiveDocument.Paragraphs(1).DropCap
If Not (drop Is Nothing) Then drop.Clear
This example removes the ALT+F1 key assignment from the Normal template.
CustomizationContext = NormalTemplate
FindKey(BuildKeyCode(Arg1:=wdKeyAlt, Arg2:=wdKeyF1)).Clear