Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-01-2019, 03:29 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists 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


As post #2 says, the process is managed via an on_exit macro. Did you copy that from the demo file into your own document?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 02-04-2019, 06:00 AM
jsalas jsalas is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2013
Novice
 
Join Date: Jan 2019
Posts: 4
jsalas is on a distinguished road
Default

I believe I did, when I check it in VBA I am seeing "Document" and "ContentControlOnExit" in the drop down next to it.
Reply With Quote
  #3  
Old 02-04-2019, 01:00 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists 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

And is that macro in the 'ThisDocument' code module of you document or its template - as shown in the attachment to post #2?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 02-08-2019, 05:59 AM
jsalas jsalas is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2013
Novice
 
Join Date: Jan 2019
Posts: 4
jsalas is on a distinguished road
Default

Yes, I copied the macro over from the original document you uploaded after updating the content controls. I've attached my document, and would greatly appreciate any insight you might have.

Last edited by jsalas; 02-08-2019 at 02:20 PM.
Reply With Quote
  #5  
Old 02-08-2019, 01:07 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists 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

The code in your document works as is for me. All one need do is select an entry an exit the dropdown. If that's not working for you, check your macro security settings.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 05-19-2019, 03:31 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists 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

Changing the dropdown entries and outputs is as simple as editing the content control properties, which you can access via the Developer tab. See: https://support.office.com/en-us/art...4-0685ae00e9b4

You can have the content controls wherever you want them. Do be aware, though, that when they're placed in a header or footer, exiting them in a way that closes the header or footer won't trigger the on-exit macro.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 05-20-2019, 09:32 AM
Jfisher88 Jfisher88 is offline Multiple entries in dropdown lists Mac OS X Multiple entries in dropdown lists Office 2019
Novice
 
Join Date: May 2019
Posts: 2
Jfisher88 is on a distinguished road
Default

Thanks, I have the developer tab opened but for some reason, I can't edit the contents to change their names. Any idea why this would be happening? To be honest I'm kind of a noob with Word and may not be looking in the right spot.
Reply With Quote
  #8  
Old 05-20-2019, 02:58 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists 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

If you click on the dropdown content control, you should then be able to click on 'Properties' to edit the items.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 10-30-2019, 08:42 PM
Carlg Carlg is offline Multiple entries in dropdown lists Windows 8 Multiple entries in dropdown lists Office 2007
Novice
 
Join Date: Oct 2019
Posts: 2
Carlg is on a distinguished road
Default

I am also not sure if this was already answered as this thread is from years ago and I am not that familiar with how this works, but I am trying to create a drop down where the values listed are different than the output values. So I would have “Number 1” as the displayed value and “New York” as the output answer, etc. I tried using several of the previous codes but I need “Number 1” to go away and all I will be left with is “New York” in the document, does this make sense?
Reply With Quote
  #10  
Old 10-30-2019, 10:56 PM
Guessed's Avatar
Guessed Guessed is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,995
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

It can be done if you:
1. Set up the drop down CC with different values for Display Name and Value
2. Bind that CC to an XML Mapping element by using the XML Mapping Pane
3. Make a selection with the drop down

When you want to 'fix' the CCs to show the values, run the
4. Run a macro to convert the CC type to a Plain Text CC.
Code:
Sub ChangeCCType()
  Dim aCC As ContentControl
  For Each aCC In Selection.Range.ContentControls
    aCC.Type = wdContentControlText
  Next
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #11  
Old 10-31-2019, 06:38 AM
Carlg Carlg is offline Multiple entries in dropdown lists Windows 8 Multiple entries in dropdown lists Office 2007
Novice
 
Join Date: Oct 2019
Posts: 2
Carlg is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
It can be done if you:
1. Set up the drop down CC with different values for Display Name and Value
2. Bind that CC to an XML Mapping element by using the XML Mapping Pane
3. Make a selection with the drop down

When you want to 'fix' the CCs to show the values, run the
4. Run a macro to convert the CC type to a Plain Text CC.
Code:
Sub ChangeCCType()
  Dim aCC As ContentControl
  For Each aCC In Selection.Range.ContentControls
    aCC.Type = wdContentControlText
  Next
End Sub
I tried using this, but it did not work, it still comes up as the Display Name rather than the Value. Can you explain how I can bind the CC to an XML mapping element? I do not know how to do that.
Reply With Quote
  #12  
Old 10-31-2019, 07:34 PM
Guessed's Avatar
Guessed Guessed is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,995
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The attached doc shows how it can work.

The simplest way to get a linked CC is to insert a CC via Insert>Quick Parts>Document Property> and choose one. This will give you a plain text CC linked to that document property.

You can step up a level by going to Developer>XML Mapping Pane>{select a schema like core-properties}>right click on an element eg title and choose Insert Content Control>Combo Box.

If you want to really get serious, you should use the tools provided by Greg Maxey or Graham Mayor
Attached Files
File Type: docm Linked CC Example.docm (45.5 KB, 35 views)
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #13  
Old 11-12-2019, 03:10 PM
Guessed's Avatar
Guessed Guessed is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,995
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

jmadsen

This thread now has 128 posts in it and has headed in many different directions. You will need to provide more information if you want help. Perhaps attach your doc and describe more fully what you want to happen.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #14  
Old 03-31-2020, 12:06 PM
chriscla chriscla is offline Multiple entries in dropdown lists Windows 10 Multiple entries in dropdown lists Office 2013
Novice
 
Join Date: Mar 2020
Posts: 18
chriscla is on a distinguished road
Default back to the beginning

I applied the solution that Paul worked out in post #2 and it works great for smaller texts with more than one line.


Is it also possible to have two or more paragraphs of multiple lines as an output in the ClientDetails content control? And if so, could anyone explain me how to achieve this?
I'm using this list box in an instruction report and sometimes there is more than one paragraph of fixed text in relation with the choice in the list box.


Thanks for any advice/solution.


Chris
Reply With Quote
  #15  
Old 03-31-2020, 04:25 PM
macropod's Avatar
macropod macropod is offline Multiple entries in dropdown lists Windows 7 64bit Multiple entries in dropdown lists 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

Yes, it's possible simply by changing the Chr(11) reference to vbCr, but the amount of text that can be held in the values is quite small, plus no formatting is provided for. You might do better linking the choices to building blocks holding the desired content. Please start a new thread for that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple entries in dropdown lists Delete Multiple Entries dudeabides Office 1 07-04-2011 02:49 AM
Multiple task lists and multiple calendars kballing Outlook 0 01-18-2011 10:23 AM
Creating Multiple Contact Lists meltee78 Outlook 1 01-03-2011 09:45 PM
multiple calendar entries across a group halfhearted Outlook 0 10-11-2009 12:13 PM
Word Forms : Dropdown lists wferaera45 Word 0 04-06-2006 03:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:36 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft