View Single Post
 
Old 03-29-2019, 04:27 PM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

It's not exactly clear what determines the decision to process by tag or title. Perhaps something along the lines of:
Code:
Private Sub Document_ContentControlOnExit(ByVal oCC As ContentControl, Cancel As Boolean)
Dim i As Long
With ActiveDocument
  Select Case oCC.Tag
    Case "a"
      For i = 1 To .SelectContentControlsByTag(oCC.Title).Count
        .SelectContentControlsByTag(oCC.Title)(i).Range.Text = ""
      Next
  End Select
End With
End Sub
or:
Code:
Private Sub Document_ContentControlOnExit(ByVal oCC As ContentControl, Cancel As Boolean)
Dim i As Long
With ActiveDocument
  For i = 1 To .SelectContentControlsByTag(oCC.Tag).Count
    .SelectContentControlsByTag(oCC.Tag)(i).Range.Text = ""
  Next
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote