![]() |
#2
|
||||
|
||||
![]()
Try the following, which is based on the code in your link:
Code:
Sub OnExitDD() Dim StrRslt As String, StrPwd As String Dim lRow As Long, lCol As Long lRow = 1: lCol = 1: StrPwd = "Password" With ActiveDocument If .ProtectionType = wdAllowOnlyFormFields Then .Unprotect , StrPwd StrRslt = .FormFields("ColorPicker").Result With .Tables(1).Cell(lRow, lCol).Range Select Case StrRslt Case "Red" .Font.Color = wdColorDarkRed .Shading.BackgroundPatternColor = wdColorPink Case "Blue" .Font.Color = wdColorDarkBlue .Shading.BackgroundPatternColor = wdColorLightBlue Case "Green" .Font.Color = wdColorDarkGreen .Shading.BackgroundPatternColor = wdColorBrightGreen Case Else 'Do Nothing End Select End With .Protect wdAllowOnlyFormFields, True, NoReset:=True, Password:=StrPwd End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
color, dropdown, reaction |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
block selection in dropdown list | Intruder | Excel | 2 | 01-10-2013 10:20 AM |
![]() |
coconutt | Word VBA | 5 | 09-13-2012 05:23 PM |
![]() |
fedcco | Excel | 12 | 08-28-2012 10:43 PM |
![]() |
biffle0764 | Word | 2 | 05-09-2012 12:54 PM |
Change cell color everytime a value is selected in dropdown list | angelica_gloria | Excel | 4 | 01-27-2012 06:47 PM |