![]() |
#31
|
||||
|
||||
![]()
You need to be clear about what your requirements are.
First you asked about how to have the output appear somewhere other than where the dropdown was located, which I answered. Then you changed the question after the event to say you wanted to include the dropdown value included in the output at that other location also, which I have also answered. Now it seems you're saying you want to have the full details appear in multiple locations. Don't keep moving the goal posts. When you've decided what it is you want, post back with the details of what that is.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#32
|
|||
|
|||
![]()
OK. I have a document that I have a dropdown box for my customer on page one when I choose my customer the address pops up. There is another location on page 3 that I need the same customer name to pop up there. Like I said earlier I can get the correct address to appear on page 3. just not the name of the customer. Thank you .
|
#33
|
||||
|
||||
![]()
Try:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) Dim i As Long, StrDetails As String With ContentControl If .Title = "Client" Then For i = 1 To .DropdownListEntries.Count If .DropdownListEntries(i).Text = .Range.Text Then StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11)) Exit For End If Next With ActiveDocument .SelectContentControlsByTitle("ClientAddress").Item(1).Range.Text = StrDetails If StrDetails <> " " Then StrDetails = _ .SelectContentControlsByTitle("Client").Item(1).Range.Text & Chr(11) & StrDetails .SelectContentControlsByTitle("ClientDetails").Item(1).Range.Text = StrDetails End With End If End With End Sub 1. The dropdown (and any other ordinary control requiring only the client name) is titled 'Client'; 2. Every content control requiring just the client address is titled 'ClientAddress'; and 3. Every content control requiring the client name & address is titled 'ClientDetails'. Where you have multiple copies of any of these content controls to update, just refer to each by its index #, remembering to update all those with 'ClientAddress' before updating any with 'ClientDetails'.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#34
|
|||
|
|||
![]()
Thank you for all of your help....That is just what I needed.
|
#35
|
|||
|
|||
![]()
Paul,
Everything that you have helped we with is working fantastic, the question I have is. I have the drop down lists of my customers in 9 different places on my document, Is there a way to add a new customer to all of the drop down lists at the same time or do I need to add the customer to each drop down list in in the document individually. Last edited by maverick561145; 11-30-2015 at 12:05 PM. Reason: missed a word |
#36
|
||||
|
||||
![]()
Please be clear about your requirements - do you have nine dropdowns, each of which someone can choose a customer from, or do you have one dropdown that outputs the selection to eight different locations? These are entirely different things.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#37
|
|||
|
|||
![]()
I have nine seperate dropdown boxs that you need to choose a customer from.
|
#38
|
||||
|
||||
![]()
In that case, you need to add all the choices to all 9 dropdowns. You could, of course, just create one dropdown with all the choices, then copy/paste that dropdown to each of the other 8 locations.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#39
|
|||
|
|||
![]()
Thanks a lot, Macropod!
I've got another question, though. Unfortunately I'm absolutely new on macros... I copied the macro from the template you posted in the beginning. Then I copied the box twice, because I need two drop-down boxes next to each other in my template (that didn't work, the second box triggered a change under the first box). I want the two drop-down boxes to work individually. The output shall appear right under the box (just like in the template you posted). How do I have to change the macro/ What shall I do? Hope my question is sufficiently precise... I'd be super grateful for any help! Regards, Tim |
#40
|
||||
|
||||
![]()
If you want independent dropdowns, simply don't give them both the same title. The demonstration one is titled 'Client'. If you want the second one to trigger its own set of outputs, the existing code would need to be supplemented with its own processes within the ContentControlOnExit macro.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#41
|
|||
|
|||
![]()
Thanks again, macropod!
I just tried adding a changed process to the code. It didn't work out, though. My knowledge about macros isn't sufficient I guess. Could you, or anybody else in here, post the code that would make my template work? As usual I'd be very grateful for any help ![]() Thank you, have a good one. Regards Tim |
#42
|
||||
|
||||
![]()
Not without knowing what your template contains and how you intend it to function. Can you attach it to a post (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#43
|
|||
|
|||
![]()
Cheers!
On the second page you'll find a box containing two cells. The left cell already works as it's supposed to: I can select an entry from a drop-down list and that triggers an entry below the drop-down. That's exactly what you posted (I used your macro). The right cell shall work exactly the same way, but independently from the left cell. I want to be able to select entries in each cell (drop-down) which then triggers a line right under each drop-down. Please let me know, if I explained insufficiently. Thanks a lot!!! Regards Tim |
#44
|
||||
|
||||
![]()
Given that the second cell doesn't even have any content controls, I can only guess at what you want.
Suppose the dropdown content control in the 1st cell is titled 'ClientA' and the dropdown content control in the 2nd cell is titled 'ClientB'. Suppose also the text content control in the 1st cell is titled 'ClientDetailsA' and the text content control in the 2nd cell is titled 'ClientDetailsB'. In that case, you could use a macro like: Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) Application.ScreenUpdating = False Dim i As Long, StrDetails As String With ContentControl If .Title = "ClientA" Then For i = 1 To .DropdownListEntries.Count If .DropdownListEntries(i).Text = .Range.Text Then StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11)) Exit For End If Next With ActiveDocument.SelectContentControlsByTitle("ClientDetailsA")(1) .LockContents = False .Range.Text = StrDetails .LockContents = True End With ElseIf .Title = "ClientB" Then For i = 1 To .DropdownListEntries.Count If .DropdownListEntries(i).Text = .Range.Text Then StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11)) Exit For End If Next With ActiveDocument.SelectContentControlsByTitle("ClientDetailsB")(1) .LockContents = False .Range.Text = StrDetails .LockContents = True End With End If End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#45
|
|||
|
|||
![]()
That works perfectly! Thank you so much, macropod!!!
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
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 |