View Single Post
 
Old 04-17-2018, 01:19 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Without any indication of what code you are using to hide the bookmarked text, it is impossible to say, though probably it relates to the titles/tags of the check box controls. The following code will hide the bookmarked text in the bookmark 'bmName' when the check box tagged 'TagName' is checked - even if the bookmarked area contains check box content controls.

You may find https://www.gmayor.com/insert_content_control_addin.htm useful.

Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim oRng As Range
    Set oRng = ActiveDocument.Bookmarks("bmName").Range
    If ContentControl.Tag = "TagName" Then
        If ContentControl.Checked = True Then
            oRng.Font.Hidden = True
        Else
            oRng.Font.Hidden = False
        End If
    End If
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote