Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

Whats the text in previous formfield

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cifly - 10 Nov 2005 13:25 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.