Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 11-06-2023, 04:56 PM
Guessed's Avatar
Guessed Guessed is offline VBA to show/hide checkboxes- always showing bookmark Windows 10 VBA to show/hide checkboxes- always showing bookmark Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Hmm, bookmarks can only exist once in a document so you can't bookmark the second region with the same bookmark name. You could append a digit to the related bookmarks and adjust the code to also look for extra digits in the bookmark name.

Alternately, you could move away from the bookmark method of tagging areas for hiding and use other content controls for this purpose. The benefit of using Content Controls for your tagging is that you can loop through CCs which share an attribute like Tag or Title. For example
Code:
  Dim aCC As ContentControl
  For Each aCC In ActiveDocument.SelectContentControlsByTag("Hi")
    aCC.Range.Font.Hidden = True
  Next aCC
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm with checkboxes that hide/show bookmarked text in document dohertym Word VBA 4 05-16-2022 09:48 PM
Checkbox - toggle hide/unhide other checkboxes and their texts Basse Word VBA 2 05-11-2022 10:43 PM
Hide one bookmark when Two checkboxes are checked AVarg123 Word VBA 4 04-01-2022 06:21 PM
REf Fields show Bookmark whole cell when Bookmark is created by code. pmcpowell Word VBA 2 11-16-2019 07:05 PM
Bookmark will not show/hide based on CC Checkbox lord_kaiser Word VBA 1 04-17-2018 01:19 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:21 AM.


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