RemoveChoice Method

Microsoft FrontPage Visual Basic

RemoveChoice Method

Removes the specified choice from the specified field.

expression.RemoveChoice(Index)

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

Index    Required. A Long that represents the position of the choice within the array.

Example

The following example removes the first choice from the NewChoiceField field in the first list of the active Web site.

    Sub RemoveChoice()
'Removes first choice from array

    Dim objApp As FrontPage.Application
    Dim objListFields As listFields
    Dim objListField As ListFieldChoice

    Set objApp = FrontPage.Application
    Set objListFields = objApp.ActiveWeb.Lists.Item(0).Fields
    Set objListField = objListFields.Item("NewChoiceField")
    'Remove first choice in list
    objListField.RemoveChoice Index:=0

End Sub