View Single Post
 
Old 06-19-2021, 06:01 PM
Shhh Shhh is offline Windows 10 Office 2016
Novice
 
Join Date: Jun 2021
Posts: 3
Shhh is on a distinguished road
Question Command for repeating content control

Hola! I found a macro on here that works beautifully to clear content control. Only if the repeating content control is removed :S When the repeating content control is added, an error pops up with "Debug" and the aCC.Range.Text = "" is no longer valid.

Wondering, how does one write to add the repeating content control? Any help is greatly appreciated!

This is the original code:

Dim aCC As ContentControl
For Each aCC In ActiveDocument.ContentControls
aCC.Range.Select
If aCC.Type <> wdContentControlDropdownList Then
aCC.Range.Text = ""
Else
aCC.Type = wdContentControlText
aCC.Range.Text = ""
aCC.Type = wdContentControlDropdownList
End If
Next aCC
End Sub
Reply With Quote