I found a solution
But how do I execute the code on exit of the first dropdown? and how do lock the second drop down from manuel user selection?
Sub Validate_ContentControl()
Dim oCC As ContentControl
Dim oControls As ContentControls
Dim OCCEntry As ContentControlListEntry
Set oControls = ActiveDocument.ContentControls
Set oCC = ActiveDocument.ContentControls(1)
For i = 1 To oCC.DropdownListEntries.Count
If oCC.DropdownListEntries.Item(i).Text = oCC.Range.Text Then
Set OCCEntry = oCC.DropdownListEntries.Item(i)
' Check the text against value - can be checked directly with text
If OCCEntry.Value = OCCEntry.Value Then
If oControls(2).Title = "Dropdown2" Then
Set oLE = oControls(2).DropdownListEntries.Item(i)
oLE.Select
Else
MsgBox "Error none found"
Exit Sub
End If
End If
End If
Next i
End Sub
|