Modify Content Control Placeholder Text

Home Up Odds & Ends Photo Gallery Search Contact Me

 

 

The information in this website is provided without risk or obligation and free of charge.  However, if you have benefitted from my efforts here and would like to make a contribution to help me continue and maintain this work then any donation will be greatly appreciated. Please click the adjacent button to access PayPal.  Thank you.
 

This Microsoft Word Help & Tips page will show you how you can quickly and near effortlessly modify the placeholder text of the ContentControls in your document.

In my opinion, ContentControls are without a doubt the best enhancement in Word2007.  If you haven't used these yet then be sure to enable the Developer Tab of your Word2007 application and check them out.  You won't be disappointed.

:old:Bonus Tip:  To enable the Developer Tab and access to ContentControls, select the Office Button then "Word Options" then "Popular" and check "Show Developer tab in the Ribbon"

Using the Controls Group on the Developer Tab you can insert one of seven different ContentControls in your Word document.  Six of the seven control types includes a default placeholder text (the Picture ContentConrols does not use placeholder text).  Also using the Controls Group you can set the properties for the various control types.  For reasons unknown to me:dunno , Microsoft left out the option to modify the placeholder text.

The illustrations below show the default placeholder text for a plain text and dropdown ContentContol and the corresponding properties dialog.  There is no method in the properties dialog to modify the placeholder text. 

Perhaps it's just a nit with me, but I think the document would look much more polished and professional if the placeholder text reflected exactly what we want the user to to do (e.g., enter their name and pick their team color).

Fortunately we can do this by clicking the Design Mode command and editing the Placeholder text directly or programatically with the simple macro shown below. :beerchug:

The VBA macro code for this simple task is as follows:

    Sub SetPlaceHolderText()
    Dim pStr As String
    If Selection.Range.ContentControls.Count = 1 Then
        On Error GoTo Err_Handler
        With Selection.Range.ContentControls(1)
            pStr = .PlaceholderText
            .SetPlaceHolderText , , InputBox("Type your new placeholder text below.", _
                                                                       "Define Placeholder Text", pStr)
        End With
    Else
        MsgBox "You must select a single ContentControl." & vbCr + vbCr _
                        & "Click the ""empty"" or ""title"" tag of the" _
                        & " ContentControl you want to modify."
    End If
    Exit Sub
    Err_Handler:
    End Sub
Need help applying macros?  See fellow MVP Graham Mayor's  Guide for Installing Macros 

Looking for something else?

Google