ContentControlListEntries.Add Method
Adds a new list item to a drop-down list or combo box content control and returns a ContentControlListEntry object.
Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)
Syntax
'Declaration
Function Add ( _
Text As String, _
Value As String, _
Index As Integer _
) As ContentControlListEntry
'Usage
Dim instance As ContentControlListEntries
Dim Text As String
Dim Value As String
Dim Index As Integer
Dim returnValue As ContentControlListEntry
returnValue = instance.Add(Text, Value, _
Index)
ContentControlListEntry Add(
string Text,
string Value,
int Index
)
Parameters
- Text
Type: System.String
Specifies the display text for the list item. Corresponds to the Text property for a ContentControlListEntry object.
- Value
Type: System.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
Type: System.Int32
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.
Return Value
Type: Microsoft.Office.Interop.Word.ContentControlListEntry
ContentControlListEntry
Remarks
List entries must have unique display names. Attempting to add a list item that already exists raises a run-time error.
See Also
Reference
ContentControlListEntries Interface