View Single Post
 
Old 11-30-2017, 03:12 PM
namrehx namrehx is offline Windows 10 Office 2013
Novice
 
Join Date: Nov 2017
Posts: 12
namrehx is on a distinguished road
Default

Hi,

What I had working for a single checkbox and bookmark before needing help with multiple bookmarks for one checkbox was this:

Code:
 Private Sub CheckBox1_Click()
    Dim ShowText As Range
    Dim HideText As Range
    
    Set ShowText = ActiveDocument.Bookmarks("Bookmark1").Range
    Set HideText = ActiveDocument.Bookmarks("Bookmark1").Range
    
    If CheckBox1.Value = True Then
        ShowText.Font.Hidden = True
        HideText.Font.Hidden = False
    Else
        ShowText.Font.Hidden = False
        HideText.Font.Hidden = True
    End If

End Sub
The code that you provided makes the bookmark disappear when checking the checkbox. I'm trying to make it so that the bookmark appears when the checkbox is checked and not unchecked.
Code:
Private Sub CheckBox1_Click()
 
ActiveDocument.Bookmarks("Bookmark1").Range.Font.Hidden = CheckBox1.Value

End Sub
Using your coding, how would you make the bookmark appear instead of disappearing when checking the checkbox?
Reply With Quote