#1
|
|||
|
|||
Word VBA nested fields show based on checkbox
Hi, I got the following code from this forum. Now i have nested fields end everytime i check a checkbox in a nestedfield it auto unchecks again. Is it possible to have nested fields that show based on a checkboxes? For example. Checkbox 1 checked = Show table with content. In that table there are some questions and another checkbox (Checkbox 2) if checked it will show extra content. Code:
Option Explicit Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean) Dim Val As Long With CCtrl Select Case .Title Case "Checkbox1", "Checkbox2", "Checkbox3", "Checkbox4", "Checkbox5", "Checkbox6", "Checkbox7", "Checkbox8": ActiveDocument.CustomDocumentProperties("Chk" & Right(.Title, 1)).Value = (.Checked = True) ^ 2 ActiveDocument.Fields.Update End Select End With End Sub |
#2
|
||||
|
||||
We would need to see the code of your nested fields (or the document you are using the code in) in order to provide direct advice.
However, it might be simpler if you used a solution where the 'fields' were actually Content Controls.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Quote:
If you click on the checkbox behind "Investment" the document shows all tables from that category. Then if you scoll down to: "Impact assessment considerations" I have put an extra checkbox that should open 1 more table beneath that table. It will open on first click but the checkbox deselects after clicking while it should stay checked. |
#4
|
|||
|
|||
Solved
I solved it with the bookmark way
|
Tags |
fields, vba |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Nested Fields using Conga for Salesforce | new user | Mail Merge | 5 | 12-15-2022 04:02 PM |
Show/Delete paragraph based on checkbox status | mahaabub | Word VBA | 1 | 05-13-2019 05:33 PM |
VBA in Word 2010 to show certain text only when a YES checkbox is checked | kdsim | Word VBA | 0 | 05-16-2018 05:16 AM |
Bookmark will not show/hide based on CC Checkbox | lord_kaiser | Word VBA | 1 | 04-17-2018 01:19 AM |
Show/Hide Text based on Checkbox Selection | tammytran105 | Word VBA | 7 | 10-02-2014 04:30 PM |