#1
|
|||
|
|||
Hide/Show text based upon check box status
I have been looking through the 2 forum posts at the bottom of this post and can't seem to get a working product.
Attached is a file with my attempt. It seems that checking the box won't update the custom document property. I might have the custom doc prop set up wrong? Also, is there any way to set it up such that when the checkbox is selected an entire section of text shows/hides. This way you could keep formatting such as bulleting. My overall goal is to have various check boxes at the top of the document that would then hide/show appropriate lines/sections in the following document. Any help would be greatly appreciated. https://www.excelforum.com/word-prog...show-text.html https://windowssecrets.com/forums/sh...BA-Word-Macros |
#2
|
||||
|
||||
The basic problem with your code is that it isn't in the document's 'ThisDocument' code module; you've placed it in an ordinary code module instead.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Awesome that worked! I am a mechanical engineer by trade so I'm not super strong on coding, although I try.
Might you have a suggestion for how to make formatting like bullet points be carried along with the text? And any suggestions on how to hide an entire block of text or a specific section? |
#4
|
||||
|
||||
The conditional output text can contain multiple paragraphs, textboxes, pictures, tables, etc., with whatever formatting you require. It's all just a matter of inserting that content between the double-quotes in the IF field. The only things that are liable to create problems are the use of auto-numbered paragraphs, SEQ fields and footnotes/endnotes; most users don't have those as conditional content, though.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Is there any trick to putting Content Controls in the double quotes?
I put CheckBox2 into a quoted area controlled by CheckBox1. CB2 controls a different quoted area. It functions but CB2 continues to be filled with an X no matter the state. I did the bullet point issue figured out. It seems that bullet points wont show if you only dont have any characters in front of the bullet. Maybe there is some way to code the bullet point to avoid this error? thanks in advanced, Nate |
#6
|
||||
|
||||
You can't output active formfields, content controls or ActiveX controls that way. Since they're inside a field code, they can only display whatever state they were set up with.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
checkbox, vba |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to use checkbox to show/hide bookmarked text? | namrehx | Word VBA | 16 | 12-14-2017 01:45 PM |
Hide/Unhide Text Based on Drop Down Selection | gw1500se | Word | 3 | 02-19-2015 12:17 PM |
Show/hide text macro and security issues? | subspace3 | Word VBA | 1 | 10-05-2014 10:05 AM |
Show/Hide Text based on Checkbox Selection | tammytran105 | Word VBA | 7 | 10-02-2014 04:30 PM |
Show/hide paragraphs based on upfront decisions | miscia76 | Word | 1 | 11-13-2013 04:29 PM |