See:
https://www.msofficeforums.com/word-...html#post47254
As for your code (which isn't what you have in the attachment), a test like:
If Left(.Title, 4) = "Severity" Then
will never work, since "Severity" has more than 4 characters. There are other errors in your code, too.
Try:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
With ContentControl
If .Title = "Risk" Then
Select Case .Range.Text
Case "High": .Range.Cells(1).Shading.BackgroundPatternColorIndex = wdRed
Case "Moderate": .Range.Cells(1).Shading.BackgroundPatternColor = RGB(255, 192, 0)
Case "Critical": .Range.Cells(1).Shading.BackgroundPatternColor = RGB(192, 0, 0)
Case Else: .Range.Cells(1).Shading.BackgroundPatternColorIndex = wdNoHighlight
End Select
ElseIf .Title = "Severity" Then
Select Case .Range.Text
Case "R": .Range.Cells(1).Shading.BackgroundPatternColorIndex = wdRed
.Range.Cells(1).Range.Font.Color = wdRed
Case "Y": .Range.Cells(1).Shading.BackgroundPatternColor = RGB(255, 192, 0)
.Range.Cells(1).Range.Font.Color = RGB(255, 192, 0)
Case "DR": .Range.Cells(1).Shading.BackgroundPatternColor = RGB(192, 0, 0)
.Range.Cells(1).Range.Font.Color = RGB(192, 0, 0)
Case "G": .Range.Cells(1).Shading.BackgroundPatternColor = wdGreen
.Range.Cells(1).Range.Font.Color = wdGreen
Case "BG": .Range.Cells(1).Shading.BackgroundPatternColor = wdBrightGreen
.Range.Cells(1).Range.Font.Color = wdBrightGreen
Case Else: .Range.Cells(1).Shading.BackgroundPatternColorIndex = wdNoHighlight
End Select
End If
End With
End Sub