Multiple Checkboxes

S

Steve C

Using the Control Toolbox, I've placed 5 check boxes and an OK command button
in a Word document. I'm looking for the proper command line(s) that, when
the user clicks OK, will search each checkbox in the document to see if it is
checked. If so, run code based on that selection. Can someone get me
started? Thanks!
 
H

Helmut Weber

Hi Steve C,

maybe you are lokking for something like that:

Private Sub CommandButton1_Click()
Dim inls As InlineShape
Dim Mynum As Long
For Each inls In ActiveDocument.InlineShapes
If inls.OLEFormat.ClassType = "Forms.CheckBox.1" And _
inls.OLEFormat.Object.Value = True _
Then
Mynum = Mynum + 1
End If
Next
If Mynum = 5 Then
MsgBox "my action"
End If
End Sub
--

Greetings from Bavaria, Germany

Helmut Weber

Vista Small Business, Office XP
 

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