|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
how to make sections hidden/appear based on selection in Cont. Ctrl. Drop-down list
Hi all,
First-time poster here, but have read a lot of posts that have gotten me pretty far. However, now I'm stumped. Need help with how to have portions of text (hereafter "sections") appear based on selection from a drop-down list. I can have sections appear by using nested {IF} statements and bookmarks, but can't get past 2 problems: 1) having the section text be hidden until referenced (i.e., document should look blank except for the drop-down box, and once a selection is made the rest of the text sections should appear) 2) retaining Cont. Ctrls. and formatting in the section text I've seen ideas about these in other posts, but none of them seem to work for me based on enterprise-enforced MS Word restrictions in my work setting. Please see the limitations and strong preferences below: Limitations: -Only have access to Word 2013 -The "section" text must retain all formatting exactly (e.g., color-coding, indents, Cont. Ctrl. boxes, tables, etc.) -The Cont. Ctrls. in the section text must remain functional and cannot be Legacy Forms or Active X. Strong preferences: -If at all possible, the section text should remain fully editable (no restricted editing) -Avoid VBA. 1) I need to be able to make future revisions of the form, but know next to nothing about VBA. 2) In my work setting, VBA will likely be problematic. -A Cont. Ctrl. drop-down for the initial drop-down (right now it's a Legacy in order to get the "Calculate on exit" function). Those are preferences, so if the task requires breaking one of those preferences I would still like to know since I *may* be able to have this deployed in my work setting. Last bit to consider: my work setting may be moving to Office 2016 within a year. Would the task be possible or more easily achieved in Word 2016? I've attached a sample Word file for what I need (incl.Bookmarks, the drop-down, {IF} statements, etc.). The "A" and "B" text blocks should initially be hidden, but populate when matching selection is picked from the drop-down with all formatting intact and fully editable. Thank you just for reading all this!!! |
#2
|
|||
|
|||
Your task will be no easier in Word 2016.
I believe with Content Controls rather than legacy formfields vba will be required. It is possible that you could store than vba in distributed global templates rather than in particular templates. Essentially the vba is going to tell when the user changes the content control. Last I heard, there is no change event for content controls, but I may be out of date. You might want to, instead, look into a UserForm. Create a Simple Userform Learn about styles and ability to limit styles in documents. Use those to control formatting. Consider using AutoText or other building blocks for your text to be inserted. Automated Boilerplate Using Microsoft Word You should be using a template, not a document. This is true whether or not you are using vba. Templates in Microsoft Word And no, you guessed right, this is not going to be a simple project to create or to implement. |
#3
|
||||
|
||||
Quote:
• the use of IF fields to conditionally show/hide the text; • the use of 'hiiden' font formatting; • using VBA to conditionally add/remove the content. Quote:
Quote:
Given your stipulations, it seems the only workable approach would be to use bookmarked ranges for where the conditional content is to go and to store that content, with all its formatting in an external document from where it can be copied into the 'main' document - use VBA code tied to the content control 'on exit' event. It also means having two documents and, if your users can't be guaranteed to have access to a common folder in which that document is stored, both would need to be kept in the same folder.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
See also: Create a Form Using Word Content Controls, and Word Content Controls.
You could create Mapped Dropdown Content Controls. perhaps using Greg Maxey's Content Control Tools. Then use them in IF Fields. This requires no bookmarks. While Greg's Content Control Tools does use vba, this would be used in the construction of the form, not in its use. The thing is that you cannot reliably predict the updating of those IF fields. You would need to either do it with vba or train your users on how to do it manually. (Usually, it is not very hard.) Note also that there is an inherent limitation in the size of an IF field. You could get around that by using AutoText fields in the results. Again, a UserForm, perhaps stored in a Global Template, would probably be simpler. Yes, you would need to learn some vba; your users would not. The UserForm could be launched with a macro attached to a keyboard shortcut and/or a QAT button, both of which could be stored in that global template. |
#5
|
||||
|
||||
That's much less an issue than the fact the displayed field content is not editable in a meaningful way. As soon as anything causes the filed to refresh (e.g. printing the document), the edits would disappear.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
Quote:
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word VBA - "Page left Blank" between Sections to make all Sections start on even page | Cov_ATC | Word VBA | 10 | 11-28-2021 03:41 PM |
How to link a drop down list to certain sections/headings? | Johnheng82 | Word | 0 | 02-22-2017 04:36 PM |
Hide/Unhide Text Based on Drop Down Selection | gw1500se | Word | 3 | 02-19-2015 12:17 PM |
Dynamically changing drop-down list based on selection? (Word Form) | laurarem | Word | 1 | 02-21-2013 10:17 PM |
Change cell color when selection is made from a drop down list | fedcco | Excel | 12 | 08-28-2012 10:43 PM |