DropDown.ListEntries property (Word)
Returns a ListEntries collection that represents all the items in a DropDown object.
Syntax
expression. ListEntries
expression An expression that returns a 'DropDown' object.
Remarks
For information about returning a single member of a collection, see Returning an object from a collection.
Example
This example retrieves the text of the active item from the drop-down form field named "DropDown1."
Set myField = ActiveDocument.FormFields("DropDown1").DropDown
num = myField.Value
myName = myField.ListEntries(num).Name
This example retrieves the total number of items in the active drop-down form field (the document should be protected for forms). If there are two or more items, this example sets the second item as the active item.
Set myField = Selection.FormFields(1)
If myfield.Type = wdFieldFormDropDown Then
num = myField.DropDown.ListEntries.Count
If num >= 2 Then myField.DropDown.Value = 2
End If
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for