View Single Post
 
Old 03-31-2022, 08:51 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
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 ofgmayor has much to be proud of
Default

The following will do that, however you should be aware that if the font is hidden it can easily be un-hidden by anyone viewing the document in Word format. Change BMName to the name of the bookmark.
Code:
Private Sub CheckBox1_Click()
    ActiveWindow.View.ShowHiddenText = False
    If CheckBox1.Value = True And CheckBox2.Value = True Then
        ActiveDocument.Bookmarks("BMName").Range.Font.Hidden = True
    Else
        ActiveDocument.Bookmarks("BMName").Range.Font.Hidden = False
    End If
End Sub

Private Sub CheckBox2_Click()
    ActiveWindow.View.ShowHiddenText = False
    If CheckBox1.Value = True And CheckBox2.Value = True Then
        ActiveDocument.Bookmarks("BMName").Range.Font.Hidden = True
    Else
        ActiveDocument.Bookmarks("BMName").Range.Font.Hidden = False
    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