![]() |
|
|
Thread Tools | Display Modes |
#2
|
||||
|
||||
![]()
I wouldn't do this with collapsed subheadings. Instead I would place the subquestions into a rich text Content Control and then hide/show that range according to the answer they give. This code and attached document shows how I've made it so you don't need to edit the code to add more sections - just set up the CC title or tag properties in matching pairs.
Code:
Private Sub Document_ContentControlOnExit(ByVal aCC As ContentControl, Cancel As Boolean) Dim aCCont As ContentControl If aCC.Tag = "Has Subquestions" Then For Each aCCont In ActiveDocument.SelectContentControlsByTitle(aCC.Title & " Subquestions") aCCont.Range.Font.Hidden = Not aCC.Checked Next aCCont End If End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Tags |
checkboxes, contentcontrols |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hide one bookmark when Two checkboxes are checked | AVarg123 | Word VBA | 4 | 04-01-2022 06:21 PM |
Add / Sum checked Checkboxes labelled 1, 2, 3, etc. in Word Table - Need Macro? | klearazkrystal | Word VBA | 7 | 03-31-2019 11:50 PM |
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 |
Wanting to use checkboxes etc in a TOC to delete specific pages in a 300 page document | Tammy | Word | 4 | 10-11-2016 05:53 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 |