Hi =?Utf-8?B?Qko=?=,
I have a work template which has 2 check box form fields. I try to hide one
of the check box depending on user enter information from a text field. is
this possible? How can do this.
Yes, this should be possible. But please note that the change can only occur
when the user EXITS the "trigger" checkbox. Form fields' macros do not trigger
when you "click" or type in them, only when entering and exiting.
The following sample code hides the checkbox named Check1 if Check2 is
activated; if it's not, Check1 is not hidden.
Sub HideBox()
Dim doc As Word.Document
Dim chkToHide As Word.FormField
Dim chkTrigger As Word.CheckBox
Set doc = ActiveDocument
Set chkToHide = doc.FormFields("Check1")
Set chkTrigger = doc.FormFields("Check2").CheckBox
If doc.ProtectionType <> wdNoProtection Then _
doc.Unprotect
chkToHide.Range.Font.Hidden = chkTrigger.Value
doc.Protect wdAllowOnlyFormFields, True
End Sub
And also, can I change a text formfield's backgroud color to different color?
Sure, just select it and use Format/Borders and Shading to add a shading to the
selection. But note that you must turn off the "field shading" (button with a
"a" on it in the Forms toolbar) for this to be visible.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail
