View Single Post
 
Old 01-26-2023, 02:39 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

On Enter means the macro is running before you have made your selection. It would be more logical to run it after the CC value has been changed.

Based on the name of your macro, perhaps you are not aware that it only works when it has the right name AND the code is placed in the ThisDocument module.

Try this code
Code:
Private Sub Document_ContentControlOnExit(ByVal aCC As ContentControl, Cancel As Boolean)
  If aCC.Title = "Awaiting Response" Then
    If aCC.Checked = True Then
      aCC.Range.Paragraphs(1).Range.Font.ColorIndex = wdRed
    Else
      aCC.Range.Paragraphs(1).Range.Font.ColorIndex = wdGreen
    End If
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote