![]() |
|
#8
|
|||
|
|||
|
Gordon,
It just takes practice (lots of it). If you are talking about many CCs (rather than just five), you can simplify that code greatly: Code:
Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, Cancel As Boolean)
With CC
Select Case .Title
Case "condition", "location", "sewerage", "services", "comms"
FillFrenchCC CC
End Select
End With
End Sub
Sub FillFrenchCC(oCC As ContentControl)
Dim lngIndex As Long
With oCC
For lngIndex = 1 To .DropdownListEntries.Count
If .DropdownListEntries(lngIndex).Text = .Range.Text Then
ActiveDocument.SelectContentControlsByTitle(oCC.Title & "FR").Item(1).Range.Text = .DropdownListEntries(lngIndex).Value
Exit For
End If
Next lngIndex
End With
End Sub
Hint: If all CCs in the document are paired with a French couterpart then the code could be simplified even further. |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Multiple entries in dropdown lists
|
paul_pearson | Word VBA | 154 | 11-08-2025 03:51 PM |
| Help with Dropdown Lists | Gerardo G | Word VBA | 1 | 06-18-2015 11:10 PM |
| Dropdown Lists in Excel 2010 | janehoss | Excel | 0 | 12-01-2014 07:16 AM |
VBA Dropdown change list Entries automatically
|
QA_Compliance_Advisor | Word VBA | 20 | 09-16-2014 07:29 AM |
| Word Forms : Dropdown lists | wferaera45 | Word | 0 | 04-06-2006 03:02 AM |