Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-03-2016, 07:59 PM
macropod's Avatar
macropod macropod is offline Output based on Combo Box selected items in Microsoft Word Windows 7 64bit Output based on Combo Box selected items in Microsoft Word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Output based on Combo Box selected items in Microsoft Word Moving Selected Items from a Multiselect Listbox on a userform to a bookmark in Word marksm33 Word VBA 3 01-15-2015 07:55 PM
Output based on Combo Box selected items in Microsoft Word Need help creating a Word document that is populated based on certain selected values alidaanish Word 1 01-10-2014 10:44 PM
Output based on Combo Box selected items in Microsoft Word Combo Box Items BoringDavid Word VBA 12 12-12-2013 05:14 AM
Display paragraph of text based on value selected in combo WordWaza Word 0 08-09-2013 06:30 AM
Bold list items in a combo box DrewB Word VBA 0 07-17-2009 11:32 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:36 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft