Dropdown selection affect color of field result on exit?

L

Lenny

I would like to set up a simple dropdown with only three entries. Upon
making a selection from one of the three options and exiting the field, I
would like to accomplish the following:
If A is selected, the resulting text "A" is RED on exit
If B is selected, the resulting text "B" is GREEN on exit and...
If C is selected, the resulting text "C" is Black on exit

I have set up dropdowns where the selection affects other fields but not the
same field. Can this be accomplished? and... what would the code look like
(select case or if, then or else).

My thanks in advance for help with this problem... Regards
 
D

Doug Robbins - Word MVP

Run a macro containing the following code on exit from the Dropdown

Dim Color As String
With ActiveDocument.FormFields("Dropdown1")
Color = .result
ActiveDocument.Unprotect
Select Case Color
Case "A"
.Range.Font.Color = wdColorRed
Case "B"
.Range.Font.Color = wdColorGreen
Case "C"
.Range.Font.Color = wdColorBlack
End Select
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
L

Lenny

:
Doug - thank you again for taking the time to help.... I don't suppose you
would like to take a crack at my other post regarding macros?

'everything I learned about macros - I learned here from my betters'

Thanks - Lenny
 
D

Doug Robbins - Word MVP

I had already done that.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top