![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#2
|
||||
|
||||
|
That code looks suspiciously like some I've posted here...
To work with multiple content controls, you could tag each of the output ones to match the titles of the ones you're using for the inputs, then use code like: Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, StrDetails As String
With ContentControl
Select Case .Title
Case Is = "Choice1"
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
ActiveDocument.SelectContentControlsByTag("Choice1").Item(1).Range.Text = StrDetails
Case Is = "Choice2"
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
ActiveDocument.SelectContentControlsByTag("Choice2").Item(1).Range.Text = StrDetails
Case Else
End Select
End With
End Sub
StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11)) if the output has multiple lines; otherwise you could use just: StrDetails = .DropdownListEntries(i).Value
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Populate Word Drop-down list with Excel column then auto fill form fields with Excel data | Faldinio | Word VBA | 7 | 10-19-2014 06:03 AM |
| Link multiple cells in drop-down lists | Trial4life | Excel | 0 | 09-08-2014 05:08 AM |
Multiple Choice Drop Down List
|
teza2k06 | Word | 1 | 04-29-2014 04:54 PM |
| Multiple Drop Down Lists in word | ali212006 | Word | 3 | 03-13-2013 12:16 PM |
| Using both drop down lists and blank cells for text | voltarei | Word | 0 | 03-18-2010 04:16 AM |