View Single Post
 
Old 01-26-2012, 02:44 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,359
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

Hi Weed,

You would need 'On Exit' macros attached to the dropdowns for this.

For the "Highest Urgency", "Normal urgency" and "High urgency" dropdown, the code might be:
Code:
Sub ColorIt()
Dim Pwd As String
Pwd = ""
With ActiveDocument
  If .ProtectionType = wdAllowOnlyFormFields Then
    .Unprotect Password:=Pwd
  End If
  With .FormFields("Dropdown1")
    Select Case .Result
      Case "Normal urgency"
        .Range.Font.Color = wdColorBrightGreen
      Case "High urgency"
        .Range.Font.Color = wdColorYellow
      Case "Highest Urgency"
        .Range.Font.Color = wdColorRed
      Case Else
        .Range.Font.Color = wdColorAutomatic
    End Select
  End With
  .Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=Pwd
End With
End Sub
For the document list, the issue is somewhat more complicated, since you're wanting to populate one dropdown based on the results of another. Although that part is fairly straightforward, where does the list come from (eg by checking the contents of different folders, by reading a list fromn a separate file, or is it hard-coded)?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote