Hello, in Presenter 24.2.2 I have created a document with 6 cards, I have added the ‘New card’ button that randomly shows one of six cards, a second ‘HOME’ button takes me to the start of the presentation from any card. If I apply ‘F5’ the presentation starts, but the buttons on each card do not work according to the macro, if I exit presentation mode the buttons work very well. I request help to find a solution, below is the code:
REM ***** BASIC *****
Sub ElegirNuevaTarjeta
Dim oDoc As Object
Dim oController As Object
Dim oDrawPages As Object
Dim nRandomPage As Integer
oDoc = ThisComponent
oController = oDoc.getCurrentController()
oDrawPages = oDoc.getDrawPages()
' Generar un número aleatorio entre 2 y 7
Randomize
nRandomPage = Int((7 - 2 + 1) * Rnd + 2)
' Cambiar a la lámina seleccionada de forma aleatoria
oController.setCurrentPage(oDrawPages.getByIndex(nRandomPage - 1))
End Sub
Sub IrALaminaPrincipal
Dim oDoc As Object
Dim oController As Object
Dim oDrawPages As Object
oDoc = ThisComponent
oController = oDoc.getCurrentController()
oDrawPages = oDoc.getDrawPages()
' Cambiar a la primera lámina (lámina del título principal)
oController.setCurrentPage(oDrawPages.getByIndex(0))
End Sub
At the suggestion of someone on the forum, I share the Impress document with the macro in question.
Test_oscar.odp (14.5 KB)