Hey NG
I try to construct a function, at formfield exit, with which i can change
the color of the text in the formfield, based on the text in it at exit.
Eg. In my formfield, i have two different numbers "1" and "2". If the text,
at exit, is "1", then the text (the number 1) should be blue. If it is 2,
then the color of the number should change to purple.
Does anyone have a solution, code, for this maneuvre?
Thx in advance,
Cifly
Doug Robbins - Word MVP - 10 Nov 2005 20:40 GMT
Run a macro containing the following code on exit from the formfield:
With ActiveDocument.FormFields("Text1")
If .result = 1 Then
ActiveDocument.Unprotect
.Range.Font.Color = wdColorBlue
Else
ActiveDocument.Unprotect
.Range.Font.Color = wdColorPlum
End If
ActiveDocument.Protect wdAllowOnlyFormFields, noreset
End With

Signature
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
> Hey NG
>
[quoted text clipped - 9 lines]
> Thx in advance,
> Cifly
Cifly - 11 Nov 2005 12:20 GMT
> Run a macro containing the following code on exit from the formfield:
>
[quoted text clipped - 8 lines]
> ActiveDocument.Protect wdAllowOnlyFormFields, noreset
> End With
Great. Thx. It did the trick!
Have a great weekend.
Cifly