No - you only need the one macro, but it needs fine tuning to ensure the
correct colour is selected.
Let's assume that the three fields are Check1 (Red), Check2 (Orange), and
Check3 (Green), then the following will colour those check boxes
accordingly. If you have more than one set of check boxes, say Check4 (Red),
Check5 (Orange), and Check6 (Green) then add the box names to the case
statements eg
Case "Check1", "Check4"
Etc
Case "Check2", "Check5"
Etc
Case "Check3", "Check6"
Etc
The password for the form goes between the quotes in the line
sPassword = ""
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Private mstrFF As String
Sub EmphasiseCheckedBox()
Dim oFld As FormFields
Dim sCount As Integer
Dim bProtected As Boolean
Dim sPassword As String
sPassword = "" 'Insert the password (if any), used to protect the form
between the quotes
With GetCurrentFF 'Establish field is current
mstrFF = GetCurrentFF.name
End With
Set oFld = ActiveDocument.FormFields
sCount = oFld(mstrFF).CheckBox.Value 'Get the Checkbox field value
'Check if the document is protected and if so unprotect it
If ActiveDocument.ProtectionType <> wdNoProtection Then
bProtected = True
ActiveDocument.Unprotect Password:=sPassword
End If
With oFld(mstrFF).Range
If sCount = True Then
Select Case oFld(mstrFF).name
Case "Check1"
.Font.Color = wdColorRed
Case "Check2"
.Font.Color = wdColorOrange
Case "Check3"
.Font.Color = wdColorGreen
End Select
Else
.Font.Color = wdColorAutomatic 'Set the colour of the unchecked
box
End If
End With
'Re-protect the form and apply the password (if any).
If bProtected = True Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=sPassword
End If
End Sub
Private Function GetCurrentFF() As Word.FormField
Dim rngFF As Word.Range
Dim fldFF As Word.FormField
Set rngFF = Selection.Range
rngFF.Expand wdParagraph
For Each fldFF In rngFF.FormFields
Set GetCurrentFF = fldFF
Exit For
Next
End Function
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>