WARNING: in one of the last lines shown below, the name of your presentation must be indicated correctly (ShuffledSlides), or this will affect the whole process.
REM Credit to FJCC
REM moderator of the Apache OpenOffice.org Community forum
REM who wrote this macro from scratch in 2010
Sub SlideShuffle
oDoc = ThisComponent
DPages = oDoc.getDrawPages
Count = DPages.Count
DIM List(Count-1) as Integer
DIM RndList(Count-1) as Integer
DIM TmpList(Count-1) as Integer
For i = 0 to Count-1
List(i) = i
next i
For x = Count-1 to 0 Step -1
Redim TmpList(x)
RndNum = INT(Rnd*(x+1))
RndList(Count-1-x) = List(RndNum)
If x > 0 then
If RndNum > 0 then
For i = 0 to RndNum - 1
TmpList(i) = List(i)
next i
end if
If RndNum < x then
For i = RndNum + 1 to x
TmpList(i-1) = List(i)
next i
end if
Redim List(x-1)
List() = TmpList()
end if
next x
CustPres = oDoc.getCustomPresentations()
MyCust = CustPres.getByName("ShuffledSlides")
SlideCount = MyCust.Count
If SlideCount > 0 then
For x = 0 to SlideCount -1
MyCust.removeByIndex(0)
next x
end if
For x = 0 to Count-1
RndSlide = DPages.getByIndex(RndList(x))
MyCust.insertByIndex(x, RndSlide)
next x
End Sub
Save and close the macro creation window and then save the presentation again.Now we need the slides to be mixed every time the file is opened, that is basically the shuffle macro has to be activated every time we open the presentation. To do this, go to the menu Tools → Customize... and in the Events tab under Open document press the button on the right Macro and search for the macro created, following the path byte.odp → Standard → shuffle followed by OK button.Save the document, close it completely and try to reopen it again. Now, pressing the F5 key to show the presentation the slides should appear in random order.Close the document (you will be asked to save, but it is not necessary to do it) and try to reopen the presentation again: the order in which the slides appear should be different to the previous time.You can use an empty template here or see the presentation shown during the Science Day at this link."Copy and paste" the following code that will allow you to mix the slides of the presentation (Credits to FJCCR, moderator of the Apache OpenOffice.org Community forum, who wrote this macro from scratch in 2010)