D
Dave
Hello,
I'm trying to write a macro that will toggle text in a bookmark between
hidden and unhidden using a checkbox. I still need the text visible on
screen, but I just don't want the text to print. I managed to make it work
one time, but something must have gone wrong in my code. Does anyone have a
better suggestion or can spot what I'm doing wrong. My macro is below.
Sub mcr1A()
ActiveDocument.Unprotect Password:=""
Set vCheck1 = ActiveDocument.FormFields("chk1A").Range
If vCheck1 = False Then
ActiveDocument.Bookmarks("bk1A").Select
With Selection.Font
.Hidden = True
End With
End If
ActiveDocument.Protect Password:="", NoReset:=True, Type:= _
wdAllowOnlyFormFields
End Sub
I'm trying to write a macro that will toggle text in a bookmark between
hidden and unhidden using a checkbox. I still need the text visible on
screen, but I just don't want the text to print. I managed to make it work
one time, but something must have gone wrong in my code. Does anyone have a
better suggestion or can spot what I'm doing wrong. My macro is below.
Sub mcr1A()
ActiveDocument.Unprotect Password:=""
Set vCheck1 = ActiveDocument.FormFields("chk1A").Range
If vCheck1 = False Then
ActiveDocument.Bookmarks("bk1A").Select
With Selection.Font
.Hidden = True
End With
End If
ActiveDocument.Protect Password:="", NoReset:=True, Type:= _
wdAllowOnlyFormFields
End Sub