Think I have it sorted. Works so far. Thanks for all your help everyone.
Private Sub Document_ContentControlOnexit(ByVal aCC As ContentControl, Cancel As Boolean)
Dim aCC2 As ContentControl, sTag As String
Select Case aCC.Title
Case "C1"
If aCC.Type = wdContentControlCheckBox Then
sTag = aCC.Tag
Set aCC2 = ActiveDocument.SelectContentControlsByTitle(sTag)( 1)
With aCC2
If aCC.Checked Then
aCC2.Range.Text = "Title" & Chr(10) & "First line"
aCC2.Range.Words(1).Bold = True
Else
aCC2.SetPlaceholderText Text:="Blank"
aCC2.Range.Text = ""
End If
End With
End If
End Select
Select Case aCC.Title
Case "C2"
If aCC.Type = wdContentControlCheckBox Then
sTag = aCC.Tag
Set aCC2 = ActiveDocument.SelectContentControlsByTitle(sTag)( 1)
With aCC2
If aCC.Checked Then
aCC2.Range.Text = "Title1" & Chr(10) & "First line1"
aCC2.Range.Words(1).Bold = True
Else
aCC2.SetPlaceholderText Text:="Blank"
aCC2.Range.Text = ""
End If
End With
End If
End Select
End Sub
|