![]() |
|
#1
|
|||
|
|||
![]()
Hi There,
I have a bookmark that shows and hide based on a CC Checkbox. What i have observed is that for some reason it does not seem to be working if there are other CC Checkboxes located in the bookmark area? Any idea why this is the case? Thanks |
#2
|
||||
|
||||
![]()
Without any indication of what code you are using to hide the bookmarked text, it is impossible to say, though probably it relates to the titles/tags of the check box controls. The following code will hide the bookmarked text in the bookmark 'bmName' when the check box tagged 'TagName' is checked - even if the bookmarked area contains check box content controls.
You may find https://www.gmayor.com/insert_content_control_addin.htm useful. Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) Dim oRng As Range Set oRng = ActiveDocument.Bookmarks("bmName").Range If ContentControl.Tag = "TagName" Then If ContentControl.Checked = True Then oRng.Font.Hidden = True Else oRng.Font.Hidden = False End If 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 |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
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 |
![]() |
nathan.gray@emerson.com | Word VBA | 5 | 12-08-2017 01:08 PM |
![]() |
tammytran105 | Word VBA | 7 | 10-02-2014 04:30 PM |
![]() |
miscia76 | Word | 1 | 11-13-2013 04:29 PM |