Class ListEntry (Word VBA)

The class ListEntry represents an item in a drop-down form field. The ListEntry object is a member of the ListEntries collection. The ListEntries collection includes all the items in a drop-down form field.


To use a ListEntry class variable it first needs to be instantiated, for example

Dim ley as ListEntry
Set ley = ActiveDocument.FormFields(1).DropDown.ListEntries(Index:=1)

The following procedures can be used to set variables of type ListEntry: DropDown.ListEntries, ListEntries.Add and ListEntries.Item

For Each

Here is an example of processing the ListEntry items in a collection.

Dim ley As ListEntry
For Each ley In ActiveDocument.FormFields(1).DropDown.ListEntries
Next ley


Returns a ListEntry object that represents an item added to a drop-down form field.

Syntax : expression.Add (Name, Index)

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


The following argument is required

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

The following argument is optional

Index (Long) - A number that represents the position of the item in the list.


Removes all items from a drop-down form field.

Documents("Sales.doc").FormFields("Colors") _ 


Returns a Long that represents the number of list entries in the collection.

Dim lngCount As Long
lngCount = ActiveDocument.FormFields(1).DropDown.ListEntries.Count


Returns an individual ListEntry object in a collection.

Syntax : expression.Item (Index)

Index: The individual object to be returned. Can be a Long indicating the ordinal position or a String representing the name of the individual object.

Sub ListEntryItem() 
 Dim d As DropDown 
 Set d = ActiveDocument.FormFields.Add _ 
 (Range:=Selection.Range, _ 
 With d.ListEntries 
 .Add Name:="Black" 
 .Add Name:="Green" 
 End With 
 MsgBox d.ListEntries.Item(1).Name 
End Sub


Returns an object that represents the parent object of the specified ListEntries object.

Dim objParent As Object
Set objParent = ActiveDocument.FormFields(1).DropDown.ListEntries.Parent


Deletes the specified list entry.



Returns a Long that represents the position of an item in a collection.

Dim lngIndex As Long
lngIndex = ActiveDocument.FormFields(1).DropDown.ListEntries(1).Index


Returns or sets the name of the specified object.

ActiveDocument.FormFields(1).DropDown.ListEntries(1).Name =


Returns an object that represents the parent object of the specified ListEntry object.

Dim objParent As Object
Set objParent = ActiveDocument.FormFields(1).DropDown.ListEntries(1).Parent