ListEntries.Item method (Word)
Returns an individual ListEntry object in a collection.
Syntax
expression.Item (Index)
expression Required. A variable that represents a 'ListEntries' collection.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Index | Required | Variant | The individual object to be returned. Can be a Long indicating the ordinal position or a String representing the name of the individual object. |
Return value
ListEntry
Example
This example clears all the items from the drop-down form field named "Colors" and then adds two color names. The Item method is used to display the first color in the drop-down form field.
Sub ListEntryItem()
Dim d As DropDown
Set d = ActiveDocument.FormFields.Add _
(Range:=Selection.Range, _
Type:=wdFieldFormDropDown).DropDown
With d.ListEntries
.Add Name:="Black"
.Add Name:="Green"
End With
MsgBox d.ListEntries.Item(1).Name
End Sub
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