Consulting

Results 1 to 12 of 12

Thread: How to add Activex control (checkbox) to every slide in presentation?

  1. #1
    VBAX Regular
    Joined
    Mar 2019
    Posts
    61
    Location

    How to add Activex control (checkbox) to every slide in presentation?

    My team creates presentations that get sent out to your client service team who, in turn, need to select some (or all) of the slides for inclusion in their "final" presentation. Because there are over 90 slides to choose from, I'd like to make it easier on them by adding a checkbox (of some sort) to each slide, so they can just check off what they want and send it back to me for further manipulation.

    Is this possible? I've been searching and searching, but only find references to Activex controls that already exist on the slide...nothing about how to add them.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    1,815
    Location
    Maybe something like

    Sub chex()
    Dim osld As Slide
    For Each osld In ActivePresentation.Slides
    With osld.Shapes.AddOLEObject(Left:=10, Top:=10, Height:=20, Width:=100, ClassName:="Forms.checkbox.1")
    .OLEFormat.Object.Caption = "Whatever"
    End With
    Next osld
    End Sub
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Wizard
    Joined
    Apr 2007
    Posts
    6,497
    Location
    You'll probably want a macro to remove the check boxes and delete the unwanted slides
    Paul

    ------------------------------------------------------------------------------------------------------------------------
    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s)
    (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    1,815
    Location
    This would togglke visibility. Easy to modify to delete

    Sub chex()
    Dim osld As Slide
    For Each osld In ActivePresentation.Slides
    With osld.Shapes.AddOLEObject(Left:=10, Top:=10, Height:=20, Width:=100, ClassName:="Forms.CheckBox.1")
    .OLEFormat.Object.Caption = "Whatever"
    End With
    Next osld
    End Sub
    
    
    Sub toggler()
    Dim osld As Slide
    Dim oshp As Shape
    Dim L As Long
    For Each osld In ActivePresentation.Slides
    For L = osld.Shapes.Count To 1 Step -1
    Set oshp = osld.shapse(L)
    If oshp.Type = msoOLEControlObject Then
    Debug.Print oshp.OLEFormat.ProgID
    If oshp.OLEFormat.ProgID = "Forms.CheckBox.1" Then
    oshp.Visible = Not oshp.Visible
    End If
    End If
    Next L
    Next osld
    End Sub
    NOTE I have corrected the case in the original ProgID Forms.checkbox.1

    Class is not case sensitive but ProgID inFind is case sensitive and should be correct or it will not work
    Last edited by John Wilson; 05-27-2019 at 02:06 AM.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    VBAX Regular
    Joined
    Mar 2019
    Posts
    61
    Location
    This sounds dumb, but how do you actually put a check mark in the boxes? Each time I hover over it, it just goes into control edit mode.

    This is exactly what I was hoping, btw Toggling is perfect.

  6. #6
    VBAX Master
    Joined
    Feb 2007
    Posts
    1,815
    Location
    You can only directly check in show mode. You could right click > properties > value = true but it would be clunky.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  7. #7
    VBAX Regular
    Joined
    Mar 2019
    Posts
    61
    Location
    Ahhh, I see. Ok, thank you!! And thanks for your solution. I really appreciate your efforts.

  8. #8
    VBAX Wizard
    Joined
    Apr 2007
    Posts
    6,497
    Location
    Another approach that doesn't require any VBA would be to just make a custom slide show by checking the slides to include

    You can rearrange them and save the custom slide show


    Capture.JPG
    Paul

    ------------------------------------------------------------------------------------------------------------------------
    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s)
    (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  9. #9
    VBAX Master
    Joined
    Feb 2007
    Posts
    1,815
    Location
    Or even use add Comment
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  10. #10
    VBAX Regular
    Joined
    Mar 2019
    Posts
    61
    Location
    Unfortunately, the existing process allows the intended users to simply check a box. The powers-that-be are positive that said users won't be able to handle anything that differs from that. Silly, i know.

  11. #11
    VBAX Master
    Joined
    Feb 2007
    Posts
    1,815
    Location
    What do you mean by the "Existing Process" and how does this work in PowerPoint.

    The only way to do this as far as I know is to write an AddIn that installs a "Tick/Untick the Box" button on the ribbon.

    This obviously involves some serious coding but if you can install the addin for all users is definitely possible.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  12. #12
    VBAX Wizard
    Joined
    Apr 2007
    Posts
    6,497
    Location
    Quote Originally Posted by ajjava View Post
    Unfortunately, the existing process allows the intended users to simply check a box. The powers-that-be are positive that said users won't be able to handle anything that differs from that. Silly, i know.
    Show them the Custom Slide Show box and let them use their checkbox-ing skills there

    If they're as habit-bound as you imply, I doubt you'd ever get them to successfully use an add-in
    Paul

    ------------------------------------------------------------------------------------------------------------------------
    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s)
    (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •