从当前域中清除所有选择。
expression.clear
expression 必选。返回“应用于”列表中的对象之一的表达式。
以下示例将清除当前活点的第一个列表中类型为 fpFieldChoice 的域中的所有选择。
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