Selection of a dropdown creates another dropdown wih the list
I am using the below VB code to auto fill text based on drop down using content control. I need to also create a dropdown based on another drop down selection. How do I include in the piece of code. Please help.
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, StrDetails As String
With ContentControl
If .Title = "Company" Then
For m = 1 To .DropdownListEntries.Count
If UCase(.DropdownListEntries(m).Text) = UCase(.Range.Text) Then
Select Case m
Case 1
StrDetails = ""
Case 2
StrDetails = "Singapore"
Case 3
StrDetails = "Singapore"
Case 4
StrDetails = "Singapore"
Case 5
StrDetails = "Malaysia"
Case 6
StrDetails = "Thailand"
Case 7
StrDetails = "Cambodia"
Case 8
StrDetails = "Philippines"
Case Else: StrDetails = " "
End Select
End If
Next
ActiveDocument.SelectContentControlsByTitle("Count ry").Item(1).Range.Text = StrDetails
End If
End With
End Sub
|