ContentControlListEntries.Add (Word)

Adds a new list item to a drop-down list or combo box content control and returns a ContentControlListEntry object.

List entries must have unique display names. Attempting to add a list item that already exists raises a run-time error.

Syntax : expression.Add (Text, Value, Index)

Dim objCC As ContentControl 
Dim objLE As ContentControlListEntry 
Dim objMap As XMLMapping 
 
Set objCC = ActiveDocument.ContentControls.Add(wdContentControlDropdownList) 
 
'List items 
objCC.DropdownListEntries.Add "Cat" 
objCC.DropdownListEntries.Add "Dog" 
objCC.DropdownListEntries.Add "Equine" 
objCC.DropdownListEntries.Add "Monkey" 
objCC.DropdownListEntries.Add "Snake" 
objCC.DropdownListEntries.Add "Other"

Arguments

The following argument is required

Text (String) - Specifies the display text for the list item. Corresponds to the Text property for a ContentControlListEntry object.

The following arguments are optional

Value (String) - Specifies the value of the list item. Corresponds to the Value property for a ContentControlListEntry object. If omitted, the Value property is equal to the Text property.

Index (Long) - Specifies the ordinal position of the new item in the list. If an item exists at the position specified, the existing item is pushed down in the list. If omitted, the new item is added to the end of the list.