View Single Post
 
Old 11-06-2021, 05:13 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I assume you are trying to get to this
Code:
Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, Cancel As Boolean)
  Dim lngIndex As Long, strValue As String
  With CC
    If .ShowingPlaceholderText Then Exit Sub
    Select Case CC.Title
      Case "RAG"
        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
      Case "Seat depth"
        Select Case .Range.Text
          Case "BLUE": .Range.Font.Color = RGB(0, 176, 240)
          Case "PURPLE": .Range.Font.Color = RGB(112, 48, 160)
          Case "RED": .Range.Font.Color = RGB(178, 34, 34)
          Case "ORANGE": .Range.Font.Color = RGB(247, 150, 70)
          Case "YELLOW": .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 Select
  End With

lbl_Exit:
  Exit Sub
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote