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 / February 2004

Tip: Looking for answers? Try searching our database.

color check box form field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tabedit - 25 Feb 2004 16:49 GMT
Hopefully there is an easy answer to this.

I would like the checkbox to change color as well as, or instead of
the default result of changing to a box with an X.

The checkboxes are in a table, the color provides needed visua
emphasis.

Many thanks for any suggestion
Jean-Guy Marcil - 26 Feb 2004 14:24 GMT
Hi there,

Assign this macro to the OnExit event of your formfield checkbox:

'_______________________________________
Sub ChangeCheckboxColor()

Dim ffRange As Range
Dim myFF As FormField

ActiveDocument.Unprotect

Set ffRange = Selection.Cells(1).Range
Set myFF = ffRange.FormFields(1)
Set ffRange = myFF.Range

If myFF.Result = True Then
   ffRange.Font.Color = wdColorRed
Else
   ffRange.Font.Color = wdColorAutomatic
End If

ActiveDocument.Protect wdAllowOnlyFormFields, True

Set myFF = Nothing
Set ffRange = Nothing

End Sub
'_______________________________________

Signature

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org


> Hopefully there is an easy answer to this.
>
[quoted text clipped - 8 lines]
> ------------------------------------------------
> ~~ Message posted from http://www.WordForums.com/
tabedit - 28 Feb 2004 22:13 GMT
merci!

It is exactly what I needed!

Much appreciated
Jean-Guy Marcil - 29 Feb 2004 18:26 GMT
You're welcome!

Signature

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org


> merci!
>
[quoted text clipped - 4 lines]
> ------------------------------------------------
> ~~ Message posted from http://www.WordForums.com/
 
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.