Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you set a check box to Checked?

Status
Not open for further replies.

Elena

Technical User
Oct 20, 2000
112
US
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

 
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:
Code:
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top