View Single Post
 
Old 07-11-2016, 11:56 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

I assume we must be talking about legacy form fields, in which case you will need a macro run on exit from the checkbox field and you would have to leave the field to run it e.g.

Code:
Sub MacroOnExit()
    If GetCurrentFF.CheckBox.Value = True Then
        GetCurrentFF.Range.Font.ColorIndex = wdAuto
    Else
        GetCurrentFF.Range.Font.ColorIndex = wdRed
    End If
lbl_Exit:
    Exit Sub
End Sub

Private Function GetCurrentFF() As Word.FormField
    Set rngFF = Selection.Range.FormFields(1).Range
    Set GetCurrentFF = rngFF.FormFields(1)
lbl_Exit:
    Exit Function
End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote