View Single Post
 
Old 02-03-2016, 07:59 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,338
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For dropdown formfields, you could employ a macro like:
Code:
Sub ColorDropDown()
Dim sText As String, oFld As FormField
Const Pwd As String = ""
With ActiveDocument
  Set oFld = Selection.FormFields(1)
  sText = oFld.Result
  If .ProtectionType <> wdNoProtection Then .Unprotect Password:=Pwd
  With oFld.Range
    Select Case sText
      Case Is = "Bad"
        .Font.Color = wdColorRed
      Case Is = "Poor"
        .Font.Color = wdColorOrange
      Case Is = "Fair"
        .Font.Color = wdColorYellow
      Case Is = "Good"
        .Font.Color = wdColorGreen
      Case Is = "Excellent"
        .Font.Color = wdColorBlue
      Case Is = "Outstanging"
        .Font.Color = wdColorIndigo
      Case Else
        .Font.Color = wdColorBlack
    End Select
  End With
  .Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=Pwd
End With
End Sub
For any formfield you want to use this code with, simply designate 'ColorDropDown' as the formfield's on-exit macro.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote