Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 03-31-2022, 08:51 PM
gmayor's Avatar
gmayor gmayor is offline Hide one bookmark when Two checkboxes are checked Windows 10 Hide one bookmark when Two checkboxes are checked 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add / Sum checked Checkboxes labelled 1, 2, 3, etc. in Word Table - Need Macro? klearazkrystal Word VBA 7 03-31-2019 11:50 PM
Bookmark will not show/hide based on CC Checkbox lord_kaiser Word VBA 1 04-17-2018 01:19 AM
Need Macro to select Checkbox after two boxes are checked in a series of checkboxes rsaini Word VBA 0 01-16-2018 11:57 AM
Hide one bookmark when Two checkboxes are checked Hide error message from missing bookmark lodi123 Word 2 03-28-2017 11:24 PM
Checkboxes are unchecked in Listbox that were checked off before.How can I stop this? Rochelle711 Excel Programming 0 06-22-2014 06:16 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft