I am trying to figure out how i can shuffle the slides in one of my power point presentations when the presentation is opened.
I have the code, but trying to find out how to make it work as power point do not have event handlers. I have tried different solutions but cant get it to work.
I have tried with auto_open add-ins and also different codes but with no luck, thankful for any assistance
The code i want to run when the presentation is opened up by a user:
Sub shuffleRange()
Dim Iupper As Integer
Dim ilower As Integer
Dim ifrom As Integer
Dim Ito As Integer
Dim i As Integer
Iupper = 21
ilower = 2
If Iupper > ActivePresentation.Slides.Count Or ilower < 1 Then GoTo Err
For i = 1 To 2 * Iupper
Randomize
ifrom = Int((Iupper - ilower + 1) * Rnd + ilower)
Ito = Int((Iupper - ilower + 1) * Rnd + ilower)
ActivePresentation.Slides(ifrom).MoveTo (Ito)
Next i
Exit Sub
Err: MsgBox " Shuffle failed", vbCritical
End Sub