View Single Post
 
Old 11-14-2023, 07:23 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Try this code. Put it into the ThisDocument Module to have it run automatically when you exit any content control.
Code:
Private Sub Document_ContentControlOnExit(ByVal myCC As ContentControl, Cancel As Boolean)
  Dim aCC As ContentControl
  If myCC.Title = "Checkbox" Then
    For Each aCC In ActiveDocument.SelectContentControlsByTitle("ContentControl")
      aCC.Range.Font.Hidden = Not myCC.Checked
      aCC.Range.Paragraphs.Last.Range.Font.Hidden = Not myCC.Checked
    Next aCC
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote