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
Note: The code is designed to update the colours of the first cell in the first table in the document. You can change the table & cell references via the various 1s in the code.