clear Method

       

Clears all choices from the current field.

expression.clear

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

Example

The following example clears all choices from any fields of type fpFieldChoice in the first list of the active web.

Sub ClearAllFields()
'Clears all fields from the current list

    Dim objApp As FrontPage.Application
    Dim objList As List
    Dim objListField As Object

    Set objApp = FrontPage.Application
    Set objList = objApp.ActiveWeb.Lists.Item(0)
    'Cycle through fields
    For Each objListField In objList.Fields
        'If field is a choice field then
        If objListField.Type = fpFieldChoice Then
            'Clear all fields
            objListField.Clear
        End If
    Next objListField
    objApp.ActiveWeb.Lists.Item(0).ApplyChanges
End Sub