×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How do you set a check box to Checked?

How do you set a check box to Checked?

How do you set a check box to Checked?

(OP)
I am trying to auto-fill a protected form in MS WORD.  I was using setformresult for the fill-in and combo box fields, but it doesn't seem to work for a check box.  What should I use?

I have tried:
 Wordbasic.setformresult "Check1", -1
that is giving me a "bad parameter" error when run.

I also tried:
  WordBasic.setformresult "Check1", True
I got the same error.

Any help would be appreciated.

Thanks and best regards,

Elena

RE: How do you set a check box to Checked?

Neither -1 nor True is a valid checkbox value. The valid values are:
0 Or vbUnchecked
1 Or vbChecked
2 I'm not sure what the constant is for this one.

So you would need to change the line to:

Wordbasic.setformresult "Check1", vbChecked

If that doesnt work try 0, but the constants are nice if they're available to you in Word VBA. They should be available.

Ruairi
ruairi@logsoftware.com
Experienced with:

VB6, SQL Server, QBASIC, C(unix), MS Office VBA solutions

ALSO: Machine Control/Automation using GE and Omron PLC's and HMI(human machine interface) for industrial applications

RE: How do you set a check box to Checked?

(OP)
Thanks, but I already figured it out.  Here's what I did:

ActiveDocument.FormFields("check1").checkbox.Value = True

That seems to be working fine, now.

Best regards,

Elena

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close