duke99
10-23-2012, 10:23 AM
Hi Guys,
i found 2 Scripts. (1. by John Wilson - Make code run as slide show starts)
vbaexpress_com/kb/getarticle.php?kb_id=983
and the 2. on an other website. And I didn't get it work like this:
My Idea was run the "sort_rand"-Script everytime i hit "F5" so that my slide always sort randomly at the start of an presentation.
This is important for me because there are Questions on every slide with answers to learn. And this would help me very much. Does anybody know how to do that?
Thanks for your help and time,
duke99
Script 1:
Sub OnSlideShowPageChange()
Dim i As Integer
i = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
If i <> 1 Then Exit Sub
MsgBox "Your code goes here"
End Sub
Script 2:
Sub sort_rand()
Dim i As Integer
Dim myvalue As Integer
Dim islides As Integer
islides = ActivePresentation.Slides.Count
For i = 1 To ActivePresentation.Slides.Count
myvalue = Int((i * Rnd) + 1)
ActiveWindow.ViewType = ppViewSlideSorter
ActivePresentation.Slides(myvalue).Select
ActiveWindow.Selection.Cut
ActivePresentation.Slides(islides - 1).Select
ActiveWindow.View.Paste
Next
End Sub
i found 2 Scripts. (1. by John Wilson - Make code run as slide show starts)
vbaexpress_com/kb/getarticle.php?kb_id=983
and the 2. on an other website. And I didn't get it work like this:
My Idea was run the "sort_rand"-Script everytime i hit "F5" so that my slide always sort randomly at the start of an presentation.
This is important for me because there are Questions on every slide with answers to learn. And this would help me very much. Does anybody know how to do that?
Thanks for your help and time,
duke99
Script 1:
Sub OnSlideShowPageChange()
Dim i As Integer
i = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
If i <> 1 Then Exit Sub
MsgBox "Your code goes here"
End Sub
Script 2:
Sub sort_rand()
Dim i As Integer
Dim myvalue As Integer
Dim islides As Integer
islides = ActivePresentation.Slides.Count
For i = 1 To ActivePresentation.Slides.Count
myvalue = Int((i * Rnd) + 1)
ActiveWindow.ViewType = ppViewSlideSorter
ActivePresentation.Slides(myvalue).Select
ActiveWindow.Selection.Cut
ActivePresentation.Slides(islides - 1).Select
ActiveWindow.View.Paste
Next
End Sub