Ciao a tutti, come si fa a fare in modo che LibreOffice Impress visualizzi le slide in ordine casuale?
Su un forum di OpenOffice ho trovato questa macro:
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("FirstCust")
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
Ma ne capisco poco… mi dice che l’errore sta in questa riga:
MyCust = CustPres.getByName("FirstCust")