PDA

View Full Version : [SOLVED:] How to add Activex control (checkbox) to every slide in presentation?



ajjava
05-22-2019, 01:22 PM
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.

John Wilson
05-23-2019, 10:42 PM
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

Paul_Hossler
05-26-2019, 06:21 PM
You'll probably want a macro to remove the check boxes and delete the unwanted slides

John Wilson
05-27-2019, 12:59 AM
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

ajjava
05-29-2019, 04:06 AM
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.

John Wilson
05-29-2019, 05:03 AM
You can only directly check in show mode. You could right click > properties > value = true but it would be clunky.

ajjava
05-29-2019, 06:04 AM
Ahhh, I see. Ok, thank you!! And thanks for your solution. I really appreciate your efforts.

Paul_Hossler
06-01-2019, 11:52 AM
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


24315

John Wilson
06-02-2019, 12:56 PM
Or even use add Comment

ajjava
06-04-2019, 09:01 AM
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.

John Wilson
06-04-2019, 09:47 PM
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.

Paul_Hossler
06-05-2019, 06:35 AM
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