![]() |
|
#1
|
||||
|
||||
![]()
OK, so you set up the checkboxes using CheckBox content controls. Bookmark the show/hide text ranges with a specific name. Put that bookmark name in the tag property for each checkbox that must be checked to show that particular bookmark.
Then add the following macro into your ThisDocument module Code:
Private Sub Document_ContentControlOnExit(ByVal myCC As ContentControl, Cancel As Boolean) Dim aCC As ContentControl, bChecked As Boolean, sTag As String sTag = myCC.Tag bChecked = True 'set initial value If ActiveDocument.Bookmarks.Exists(sTag) Then For Each aCC In ActiveDocument.SelectContentControlsByTag(sTag) bChecked = bChecked And aCC.Checked Next aCC ActiveDocument.Bookmarks(sTag).Range.Font.Hidden = Not bChecked End If End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia Last edited by Guessed; 04-16-2019 at 07:33 PM. Reason: didn't add the sample doc |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Make Autocorrect Case-Specific? | rjb | Word | 4 | 11-19-2018 09:11 PM |
![]() |
modiria50989 | Word VBA | 7 | 08-14-2017 05:31 PM |
Trouble Formatting Specific Paragraphs - Bullets, Spacing, Centering, etc | adzialo | Word | 2 | 05-01-2017 12:53 PM |
![]() |
AustinBrister | Word VBA | 3 | 06-01-2015 07:00 AM |
![]() |
caboy | Word VBA | 2 | 04-01-2015 07:00 AM |