ListEntries.Add Method (Word)
Returns a ListEntry object that represents an item added to a drop-down form field.
Syntax
expression .Add(Name, Index)
expression Required. A variable that represents a ListEntries collection.
Parameters
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
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. |
Return Value
ListEntry
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