View Single Post
 
Old 06-18-2024, 06:21 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,159
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

The direct answer is to change your If line to also check that the CC is a checkbox
Code:
If ContentControl.Tag <> "" And ContentControl.Type = wdContentControlCheckBox Then
You could also use other methods to identify when a checkbox needs to change the visibility of the secondary area. All CCs have both a Tag and Title property so you could use one of these as the trigger for the macro and the other for the bookmark region.
eg
Code:
If ContentControl.Tag = "SectionShowHide" then
ActiveDocument.Bookmarks(ContentControl.Title).Range .Font.Hidden = Not ContentControl.Checked
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote