#1
|
|||
|
|||
Creating text based on drop-down menu selection
Using MS Word for Mac 2016 (version 15.32) but I'll take answers based on other iterations and on PC too.
I'm creating a template for legal proceedings. I want the selection of an item in a drop-down menu to automatically generate a line of text elsewhere in the document. More specifically, I want the selection of the judicial district (on the top-left drop-down menu on the first page) to automatically generate the address of that district's courthouse (on the third page). I also want the whole document to remain unlocked (I noticed when I add combo boxes or drop-down menus I seem to have to "protect form" to get them to function, locking down the ability to edit text anywhere besides the boxes/menus). Not sure if a macro is necessary, but I'm a total newbie to macros. I've attached the document and highlighted the relevant sections. I would be deeply grateful to anyone who could give me a hand here. I've spent nearly a week trying to figure this out. |
#2
|
||||
|
||||
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thanks, but I downloaded the file, opened it and I see the dropdown menu (i.e. Roundhouse Nurseries and Smiths Wholesale) but when I select something, nothing happens.
Am I supposed to create a Macro to run on exit? |
#4
|
||||
|
||||
The required macro is already in the document. All you need do is make a selection then exit the dropdown.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Still not working. I make a selection, then click elsewhere in the document and nothing happens. I also tried pressing "tab" and nothing happens.
I see the empty "client details" field underneath but it never changes. Keep in mind I'm opening it in MS Word for Mac 2016. I enabled marcos when opening it. When I open it in the MS Word for PC, I get a read-only doc. See screen caps. |
#6
|
||||
|
||||
Your PC version opens as read-only because the product has not been registered; I don't know why it's not working on the Mac, because MS is supposed to have added content control support to Word 2016 for the Mac. The alternative would be to use formfields and formula fields, as in: https://www.msofficeforums.com/word/...html#post46429
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
I've tried going with the alternative (ie. using formfields and formula fields) but it seems I need to "protect form" for them to work, which treats my doc like a locked form. I want all text to remain editable.
Is there a way to do this? That is to say, have drop-down fields that trigger the creation of text in IF formula fields while keeping the whole document editable? |
#8
|
||||
|
||||
With formfield protection, you can use Section breaks to delineate which parts of the document will be protected (i.e. those containing formfields) and which parts will be editable. You can achieve a reasonable level of granularity with multiple Section breaks.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
Brilliant, thanks!
Last question: How to I create multiple IF statements in one field? I want a field to display different text depending on the selection of a drop down menu, so I that means I need something like: {{IF "Dropdown1" = "Montreal", "Montreal Address"}{IF "Dropdown1" = "Laval", "Laval Address"}} But that doesn't seem to work. It doesn't update when I go "update field". |
#10
|
||||
|
||||
Unless there is a particular reason for nesting the fields, e.g.:
{IF "Dropdown1" = "Montreal", "Montreal Address" {IF "Dropdown1" = "Laval", "Laval Address" "Neither Montreal nor Laval"}} they can be independent: {IF "Dropdown1" = "Montreal", "Montreal Address"}{IF "Dropdown1" = "Laval", "Laval Address"}
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
drop down menu, form fields, macro in word |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Drop down lists and pulling data from worksheet based on drop down selection | cjoyce73 | Excel | 5 | 07-17-2017 07:40 AM |
Drop-down menu in Excel, filling up the lists according to selection | blackarrow | Excel | 18 | 01-18-2017 08:04 AM |
Hide/Unhide Text Based on Drop Down Selection | gw1500se | Word | 3 | 02-19-2015 12:17 PM |
Adding text to after a bookmark based on drop down menu choice | ksigcajun | Word VBA | 6 | 06-10-2014 09:39 AM |
Populate a table based on choices from drop down menu | Xaand | Word VBA | 0 | 02-25-2014 11:08 AM |