Results 1 to 6 of 6

Thread: Powerpoint Form

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    3

    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:
    1. Private Sub CommandButton1_Click()
    2.  
    3. Dim array1() As String
    4. Dim chk As CheckBox
    5. Dim i As Integer
    6. For Each chk In Me.Scripts
    7.    If TypeOf chk Is CheckBox Then
    8.       If chk.Value = 1 Then
    9.          array1(i) = chk.Name
    10.          i = i + 1
    11.       End If
    12.    End If
    13. Next chk
    14.  
    15. MsgBox i
    16.  
    17. 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:
    1. <div style='position:absolute;top:20.25%;left:12.35%;width:1.68%;height:4.0%'><![endif]><object
    2.   classid="CLSID:8BD21D40-EC42-11CE-9E0D-00AA006002F3" name=CheckBox1
    3.   id=CheckBox1 v:shapes="_x0000_s609286" width="100%" height="100%">
    4.   <param name=BackColor value=16777215>
    5.   <param name=ForeColor value=0>
    6.   <param name=DisplayStyle value=4>
    7.   <param name=Size value="362;714">
    8.   <param name=Value value=1>
    9.   <param name=GroupName value=Slide5>
    10.   <param name=FontName value=Arial>
    11.   <param name=FontHeight value=285>
    12.   <param name=FontCharSet value=0>
    13.   <param name=FontPitchAndFamily value=2>
    14.  </object><![if !ppt]></div>

    Any help would be greatly appreciated. Thanks.

  2. #2
    Fanatic Member dannymking's Avatar
    Join Date
    Jul 2005
    Location
    Darlington, North East UK
    Posts
    677

    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:
    1. Private Sub CommandButton1_Click()
    2.   Dim chk As CheckBox
    3.   Dim array1() As String
    4.   Dim i As Integer
    5.   For Each chk In Me.Controls
    6.     If chk.Value Then
    7.       i = i + 1
    8.       ReDim Preserve array1(1 To i)
    9.       array1(i) = chk.Name
    10.     End If
    11.   Next
    12. End Sub
    Danny

    Never Think Impossible

    If you find my answer helpful then please add to my reputation

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    3

    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!

  4. #4
    Fanatic Member dannymking's Avatar
    Join Date
    Jul 2005
    Location
    Darlington, North East UK
    Posts
    677

    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

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    3

    Re: Powerpoint Form

    Actually placing them into the slide in ppt using the control toolbox.

    Thanks!

  6. #6
    Fanatic Member dannymking's Avatar
    Join Date
    Jul 2005
    Location
    Darlington, North East UK
    Posts
    677

    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
  •  



Click Here to Expand Forum to Full Width