Quote:
Many thanks, it works. What if I have more content controls with different titles. For instance another one called "Department".
|
In a separate procedure have an Array that holds the names.
Cycle through those names calling the check control macro with each name. In the procedure that has the names, assign the variable strName to each name in turn and use:
Code:
CheckContentControl(strName)
Change the macro to something like:
Code:
Sub CheckContentControl(strName)
' Andrew Lockton
' https://www.msofficeforums.com/word-vba/52145-macro-check-data-content-control-box.html
'
Dim aCC As ContentControl, bEmpty As Boolean
For Each aCC In ActiveDocument.SelectContentControlsByTitle(strName)
bEmpty = aCC.ShowingPlaceholderText
If bEmpty Then
MsgBox "The Content Control " & strName & " is Empty"
Else
MsgBox "The Content Control " & strName & " has content"
End If
Next
End Sub