Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sets the placeholder text that displays in the content control until a user enters their own text.
Syntax
expression. SetPlaceholderText( _BuildingBlock_ , _Range_ , _Text_ )
expression An expression that returns a ContentControl object.
Parameters
| Name | Required/Optional | Data type | Description |
|---|---|---|---|
| BuildingBlock | Optional | BuildingBlock | Specifies a BuildingBlock object that contains the contents of the placeholder text. |
| Range | Optional | Range | Specifies a Range object that contains the contents of the placeholder text. |
| Text | Optional | String | Specifies the contents of the placeholder text. |
Remarks
Only one of the parameters is used when specifying placeholder text. If more than one parameter is used, Microsoft Word uses the text specified in the first parameter. If all parameters are omitted, the placeholder text is blank.
Example
The following example inserts a new drop-down list content control into the active document, sets the title and placeholder text, and then inserts several new items into the list.
Dim objCC As ContentControl
Dim objMap As XMLMapping
Set objCC = ActiveDocument.ContentControls.Add(wdContentControlDropdownList)
objCC.Title = "My Favorite Animal"
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"
objCC.DropdownListEntries.Add "Other"
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.