Share via


ContentControlListEntry.Select Method

Word Developer Reference

Selects the list entry in a drop-down list or combo box content control and sets the text of the content control to the value of the item.

Syntax

expression.Select

expression   An expression that returns a ContentControlListEntry object.

Example

The following example inserts a drop-down list content control into the active document, sets the title and placeholder text and adds several items to the list, and then selects the last item entered.

Visual Basic for Applications
  Dim objCC As ContentControl
Dim objCE As ContentControlListEntry
Dim objMap As XMLMapping

Set objCC = ActiveDocument.ContentControls.Add(wdContentControlDropdownList) objCC.Title = "My Favorite Animal" If objCC.ShowingPlaceholderText Then _ objCC.SetPlaceholderText , , "Select your favorite animal "

'List entries objCC.DropdownListEntries.Add "Cat" objCC.DropdownListEntries.Add "Dog" objCC.DropdownListEntries.Add "Horse" objCC.DropdownListEntries.Add "Monkey" objCC.DropdownListEntries.Add "Snake"

Set objCE = objCC.DropdownListEntries.Add("Other") objCE.Select

See Also