

Image controls, Group controls and (in Word 2010) checkbox controls have a PlaceholderText object, but never have a. Some content controls can have a PlaceholderText object, but no placeholder text So it does not seem possible to determine in the object model whether an image content control is showing the placeholder. However you can't compare the text of an image with the placeholder's image. So to determine whether the document is showing the placeholder text, compare the. ShowingPlaceholderText will allege that the document is showing the placeholder text, but it is not. Sometimes the document will display the placeholder text, but. ShowingPlaceholderText is wrong about half the time. My experience is that the return value for. Returns a Boolean that indicates whether the placeholder text for the content control is displayed. Word often doesn't know if a content control is displaying its placeholder textĪccording to Microsoft's documentation, the. If Not cc.PlaceholderText Is Nothing ThenĬc.SetPlaceholderText Text:="My text here" Set c = ActiveDocument.ContentControls(1) 'Assume there is at least one content control in the document Something like this: Dim cc As ContentControl PlaceholderText object in some error checking. You can't count on the PlaceholderText object being available. Value property: MsgBox M圜 The PlaceholderText object is prone to disappearing Or, you can set the placeholder text to refer to a range or an existing building block. To set the placeholder text, you need something like: M圜ontentControl.SetPlaceholderText Text:="Click here and type the report title" PlaceholderText is a BuildingBlock object. But you'd be wrong!Ī Word content control's. You'd be forgiven for thinking it would return a String.

PlaceholderText is an object, not textĪ ContentControl object has a PlaceholderText property. This article discusses some of the oddities about these placeholders in the Word object model. The 'prompt' text (eg "Click here and type the manager's name" or "Choose the date of your report") is provided through a placeholder. 5 Curiosities about Placeholders in Word Content Controls (for developers)Ĭontent Controls are an excellent way to provide 'prompt' text for users.
