![]() |
|
|
|
#1
|
||||
|
||||
|
Firstly, writing to bookmarks is non-intuitive because the added text is beside the bookmark rather than inside it. This means it works once but a second pass with the macro adds a second copy instead of replacing. You get around this shortcoming by redefining the bookmark range after writing the text. See https://www.msofficeforums.com/word-...lues-text.html for an example of this.
If you want to show/hide a range based on a checkbox, you can do it without an If statement Code:
' Hide the text if checked, show if unchecked
ActiveDocument.Bookmarks("ContinenceCost").Range.Font.Hidden = ContinenceCB
'or vice versa
ActiveDocument.Bookmarks("ContinenceCost").Range.Font.Hidden = Not ContinenceCB
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
| Tags |
| checkbox, show, userform |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Show Userform hide active document only | Just Learning | Word VBA | 4 | 03-25-2020 08:57 PM |
Auto-populating a document pulling data from external doc using a Userform with Checkboxes
|
kateabode | Word VBA | 10 | 10-12-2018 06:56 AM |
How to use checkbox to show/hide bookmarked text?
|
namrehx | Word VBA | 16 | 12-14-2017 01:45 PM |
| How to use checkbox to show and hide bookmarked text? | namrehx | Word VBA | 1 | 12-12-2017 02:17 PM |
Show userform without losing document focus? Or other method to get a graphic to pop?
|
AlexR | Word VBA | 7 | 03-31-2013 12:17 PM |