I am trying to check a checkbox, Formfields(5), by code. This is what
doesn't work:
ActiveDocument.FormFields(5).Select '(properly selects the
checkbox)
ActiveDocument.FormFields(5).Result = 1 '(runs fine, but does not
make checkbox checked)
Help, please.
TIA
Chuck - 19 Apr 2005 11:36 GMT
Try
ActiveDocument.FormFields(5).CheckBox.Value = True
to check the box and
ActiveDocument.FormFields(5).CheckBox.Value = False
to uncheck it
> I am trying to check a checkbox, Formfields(5), by code. This is what
> doesn't work:
[quoted text clipped - 6 lines]
>
> TIA
Chuck - 19 Apr 2005 15:21 GMT
BTW, you don't need to select the formfield to change its value so you can do
what you want in one line instead of two (unless of course you want to select
the formfield for some other reason).
> Try
> ActiveDocument.FormFields(5).CheckBox.Value = True
[quoted text clipped - 12 lines]
> >
> > TIA
Greg Maxey - 19 Apr 2005 11:58 GMT
zSplash,
Uses .Value to set the state. Like this:
Sub Test()
ActiveDocument.FormFields(5).Select
ActiveDocument.FormFields(5).CheckBox.Value = 1
End Sub

Signature
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
> I am trying to check a checkbox, Formfields(5), by code. This is what
> doesn't work:
[quoted text clipped - 6 lines]
>
> TIA
zSplash - 19 Apr 2005 17:29 GMT
Thanks, Chuck and Greg. You guys are absolutely the BEST!
st.
> zSplash,
>
[quoted text clipped - 15 lines]
> >
> > TIA