Andrew, Thank you so much.
I think I can see where I'm going wrong...
Below is the original code that works for the "RAG" drop down. The part in bold from the original post is for a different drop down CC "Seat depth" So I'm not sure why I just chucked it in the middle... I'll have a play around but predict I'll be back here asking again! I'm guessing I need to pop it after the DDLE value instriction but won't pretend I know what I'm doing so any help would be greatly appreciated. Thank you
Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, Cancel As Boolean)
Dim lngIndex As Long
Dim strValue As String
Select Case CC.Title
Case "RAG"
With CC
If .ShowingPlaceholderText Then Exit Sub
Select Case .Range.Text
Case "RED": .Range.Font.Color = RGB(178, 34, 34)
Case "AMBER": .Range.Font.Color = RGB(255, 165, 0)
Case "GREEN": .Range.Font.Color = RGB(50, 205, 50)
Case Else: .Range.Font.ColorIndex = wdAuto
End Select
For lngIndex = 2 To .DropdownListEntries.Count
If .DropdownListEntries(lngIndex).Text = .Range.Text Then
strValue = .DropdownListEntries(lngIndex).Value
.Type = wdContentControlText
.Range.Text = strValue
.Type = wdContentControlDropdownList
Exit For
End If
Next lngIndex
End With
Case Else
End Select
lbl_Exit:
Exit Sub
End Sub
|