View Single Post
 
Old 12-05-2016, 04:19 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

If it is a content control you have to use the OnExit event in the ThisDocument module;

Code:
Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, Cancel As Boolean)
  Select Case CC.Range.Text
    Case "Critical"
      CC.Range.Shading.BackgroundPatternColorIndex = wdRed
      CC.Range.Font.ColorIndex = wdWhite
    Case "Medium"
      CC.Range.Shading.BackgroundPatternColorIndex = wdYellow
      CC.Range.Font.ColorIndex = wdBlack
    Case "Low"
     CC.Range.Shading.BackgroundPatternColorIndex = wdGreen
     CC.Range.Font.ColorIndex = wdWhite
  End Select
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote