|
-
Sep 21st, 2005, 07:22 PM
#1
Thread Starter
New Member
Powerpoint Form
I am trying create a form in powerpoint which collects information from a menu. I'm trying to figure out how to collect information from checkboxes in my form. I would like to collect the checkbox name from each checkbox and put it in an array. I'm not sure how to achieve this in powerpoint. This is what I have so far:
VB Code:
Private Sub CommandButton1_Click()
Dim array1() As String
Dim chk As CheckBox
Dim i As Integer
For Each chk In Me.Scripts
If TypeOf chk Is CheckBox Then
If chk.Value = 1 Then
array1(i) = chk.Name
i = i + 1
End If
End If
Next chk
MsgBox i
End Sub
Problem is that it does not search for checkboxes, there is no Me.Controls, so Itried going thru the powerpoint script which looks like so:
VB Code:
<div style='position:absolute;top:20.25%;left:12.35%;width:1.68%;height:4.0%'><![endif]><object
classid="CLSID:8BD21D40-EC42-11CE-9E0D-00AA006002F3" name=CheckBox1
id=CheckBox1 v:shapes="_x0000_s609286" width="100%" height="100%">
<param name=BackColor value=16777215>
<param name=ForeColor value=0>
<param name=DisplayStyle value=4>
<param name=Size value="362;714">
<param name=Value value=1>
<param name=GroupName value=Slide5>
<param name=FontName value=Arial>
<param name=FontHeight value=285>
<param name=FontCharSet value=0>
<param name=FontPitchAndFamily value=2>
</object><![if !ppt]></div>
Any help would be greatly appreciated. Thanks.
-
Sep 22nd, 2005, 02:55 AM
#2
Re: Powerpoint Form
Hi and welcome to the site,
In terms of the app you are using, are building a userform inside powerpoint??
You can use the slides to capture information whilst the powerpoint slideshow is being used, is this what you are trying to achieve?
In terms of a userform it would be easier to itterate through the control collection..
VB Code:
Private Sub CommandButton1_Click()
Dim chk As CheckBox
Dim array1() As String
Dim i As Integer
For Each chk In Me.Controls
If chk.Value Then
i = i + 1
ReDim Preserve array1(1 To i)
array1(i) = chk.Name
End If
Next
End Sub
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Sep 22nd, 2005, 07:57 AM
#3
Thread Starter
New Member
Re: Powerpoint Form
Hey Danny, I appreciate the quick and helpful response. Yes I am trying to build a form in powerpoint. When I try to use Me.Controls I get a compile error of "Method or data member not found"
Any other suggestions.
Again, thanks!
-
Sep 22nd, 2005, 08:35 AM
#4
Re: Powerpoint Form
Are you actually using the UserForm inside the Visual Basic Editor (ALT+F11) or are you placing the checkboxes onto a slide?
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Sep 22nd, 2005, 09:49 AM
#5
Thread Starter
New Member
Re: Powerpoint Form
Actually placing them into the slide in ppt using the control toolbox.
Thanks!
-
Sep 22nd, 2005, 10:50 AM
#6
Re: Powerpoint Form
From what I remember on Power point you don't have much control on the controls on the slide in view..
You would probably be better off coding the individual controls to add to the array or remove depending on the value selected.
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|