View Single Post
 
Old 04-27-2017, 07:38 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,427
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim oCC1 As ContentControl, oCC2 As ContentControl
  If ContentControl.Title = "Impact" Or ContentControl.Title = "Likelihood" Then
    Set oCC1 = ActiveDocument.SelectContentControlsByTitle("Impact").Item(1)
    Set oCC2 = ActiveDocument.SelectContentControlsByTitle("Likelihood").Item(1)
    Select Case True
      Case oCC1.Range.Text = "Manageable" And oCC2.Range.Text = "Unlikely"
        oCC1.Range.Cells(1).Shading.BackgroundPatternColor = wdColorLime
        oCC2.Range.Cells(1).Shading.BackgroundPatternColor = wdColorLime
      Case Else
        oCC1.Range.Cells(1).Shading.BackgroundPatternColor = wdColorAutomatic
        oCC2.Range.Cells(1).Shading.BackgroundPatternColor = wdColorAutomatic
    End Select
  End If
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote