Share via


ContentControlListEntry.Value Property

Word Developer Reference

Returns or sets a String that represents the programmatic value of an item in a drop-down list or combo box content control. Read/write.

Syntax

expression.Value

expression   An expression that returns a ContentControlListEntry object.

Remarks

Use the Value property to store data that you need to use at processing time. For example, the Text property may contain a string that you want to display and the Value property may contain a number, such as an item number, that you can use to look up information in a database. Also, the value of the Value property is what is sent to the custom XML data, if the content control is mapped to XML data in the data store.

Bb242774.vs_note(en-us,office.12).gif  Note
You cannot set the Value property for list entries that were automatically populated from an XML schema attached to the custom XML that is mapped to this control.

Example
The following example sets the value for the item based on the contents of the display text.

Visual Basic for Applications
  Dim objCc As ContentControl
Dim objLe As ContentControlListEntry
Dim strText As String
Dim strChar As String

Set objCc = ActiveDocument.ContentControls(3)

For Each objLE In objCC.DropdownListEntries If objLE.Text <> "Other" Then strText = objLE.Text objLE.Value = "My favorite animal is the " & strText & "." End If Next

See Also