View Single Post
 
Old 12-12-2022, 03:56 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,160
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

You will need a second macro to fire automatically as you open the document. If you have both macros in the ThisDocument module they would be...
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
    If ContentControl.Tag = "Checkbox1" Then
        ActiveDocument.Bookmarks("Test1").Range.Font.Hidden = ContentControl.Checked
    End If
End Sub

Private Sub Document_Open()
  Dim aCC As ContentControl
  If ActiveDocument.SelectContentControlsByTag("Checkbox1").Count = 1 Then
    Set aCC = ActiveDocument.SelectContentControlsByTag("Checkbox1")(1)
    ActiveDocument.Bookmarks("Test1").Range.Font.Hidden = aCC.Checked
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote