View Single Post
 
Old 07-06-2014, 10:13 AM
lucky16 lucky16 is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Jan 2014
Posts: 21
lucky16 is on a distinguished road
Default

These are content control depended dropdowns. When an item from the content control dropdown is selected, dependent text is inseretd in the next line. Following is the code i am using.

Quote:
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
ActiveDocument.ContentControls(2).Range.Text = StrDetails
End If
End With

With ContentControl
If .Title = "Delivery contacts" 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
ActiveDocument.ContentControls(3).Range.Text = StrDetails
End If
End With
End Sub
Trying to have these dependent dropdowns side by side.

Thank you.
Reply With Quote