CheckBox Possibilities

P

Peter KNAP

Hi.

When I write code for macro to see if user checked „CheckBox“ for example:

Sub FormSingle()

Set vSingle = ActiveDocument.FormFields(“bkSingleâ€).CheckBox
If vSingle.Value = True Then
ActiveDocument.Bookmarks(“bkChildrenYesâ€).Select
Enf If

End Sub

it Works only when user use for marking appropriate chceckbox keyboard. When
the mouse is used macro do not know that check box has been checked and no
reaction written in it (macro) pass off.

Isn’t it possible to write code the way it will work also when for marking
mouse is used?
 
D

Doug Robbins - Word MVP

The following code works whether the keyboard or the mouse is used in both
Word 2000 and Word 2007

With ActiveDocument
If .FormFields("Check1").CheckBox.Value = True Then
MsgBox "Checked"
Else
MsgBox "Unchecked"
End If
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

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