check value of Checkbox in Word form

B

Byron

Is there a way to check the value of a checkbox that
exists as a forms checkbox using VBA?

Thanks for any help.

Byron
 
P

Peter Hewett

Hi Byron

Checkout the checkboxes Value property, as in:

If chkIncudeName.Value Then
' Do something
End If


HTH + Cheers - Peter
 
W

Will Nelson

You may also preced the check box with the form name, if you're checking outside the scope of the form, e.g.

If frmMyDialog.chkMyCheckBox.Value The
'code for when user selected the check bo
Els
'code for when the user deselected the check bo
End I
 
B

Byron

I really appreciate the responses, however, I am not
working with a user form, but a checkbox inserted as a
Formfield in a Word doc.

Can you help with this?

Byron
-----Original Message-----
You may also preced the check box with the form name, if
you're checking outside the scope of the form, e.g.:
 
P

Peter Hewett

Hi

Your CheckBox FormField probably has a default name of "CheckN' where N is a
number unless you've renamed it. Assuming you haven't you can use the
following code to refer to the value of the FormField:

ActiveDocument.FormFields("Check1").Result

A value of 1 = Checked and 0 = unchecked.

HTH + Cheers - Peter
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Byron,

ActiveDocument.Formfields("Check1").CheckBox.Value

will return "True" if the checkbox to which the bookmark name "Check1" is
assigned is checked and "False" if it is not.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top