Add Method (ListEntries Collection)

Applies To

ListEntries collection object.

Description

Adds an item to a drop-down form field.

Syntax

expression.Add(Name, Index)

expression Required. An expression that returns a ListEntries object.

Name Required String. The name of the drop-down form field item.

Index Optional Variant. A number that represents the position of the item in the list.

See Also

FormField object, ListEntries collection object.

Example

This example inserts a drop-down form field in the active document and then adds the items "Red," "Blue," and "Green" to the form field.

Set myField = ActiveDocument.FormFields.Add(Range:= Selection.Range, _
     Type:= wdFieldFormDropDown)
With myField.DropDown.ListEntries
    .Add Name:="Red"
    .Add Name:="Blue"
    .Add Name:="Green"
End With