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 / April 2005

Tip: Looking for answers? Try searching our database.

check a checkbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zSplash - 19 Apr 2005 09:59 GMT
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
 
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.