View Single Post
 
Old 04-21-2017, 05:16 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Irimi-Ai View Post
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
That can be done via:
• 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:
Originally Posted by Irimi-Ai View Post
Limitations:
...-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).
Unless you use legacy formfields, you cannot avoid VBA. How much VBA would be required would depend on other factors - see below.
Quote:
Originally Posted by Irimi-Ai View Post
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.
Regardless of which approach you use, nothing will be 'fully editable' if the output is controlled by field coding, since field content is not editable in a meaningful way. Although the use of hidden text formatting might initially seem attractive, it is actually quite problematic, as you have no control over whether the end user would see text that is formatted as hidden or, even if it isn't, whether it would print; those setting are controlled by the user's Word setup.

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]
Reply With Quote