[RESUELTO] Presentación aleatorio

Discute sobre la aplicación de presentaciones
Responder
mariansanchez100
Mensajes: 1
Registrado: Jue Nov 10, 2011 10:52 am

[RESUELTO] Presentación aleatorio

Mensaje por mariansanchez100 »

Me gustaría saber cómo puedo hacer una presentación en la que las diapositivas salgan de forma aleatoria cada vez que le doy a la presentación.

Gracias

Editado por el moderador (mauricio) para cambiar el "todo mayúsculas". Si no lo has hecho aún por favor lee la Guía de supervivencia
Última edición por SLV-es el Mié Jun 20, 2012 2:23 am, editado 1 vez en total.
Razón: Considero que el tema está resuelto, salvo que algún usuario se pronuncie al contrario.
OpenOffice 3.1 en Windows Vista
FJCC-ES
Mensajes: 873
Registrado: Mié Mar 25, 2009 1:19 am
Ubicación: Colorado, USA

Re: Presentación aleatorio

Mensaje por FJCC-ES »

Esta macro muestra las diapositivas en orden aleatorio.

Código: Seleccionar todo

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()
If CustPres.hasByname("MiPresentacion") Then
	MyCust = CustPres.getByName("MiPresentacion")
	SlideCount = MyCust.Count
	If SlideCount > 0 then
		For x = 0 to SlideCount -1
   			MyCust.removeByIndex(0)
		next x
	End if
Else
	NewPresentation = CustPres.createInstance()   '"com.sun.star.presentation.CustomPresentation")
	CustPres.insertByName("MiPresentacion", NewPresentation)
	MyCust = CustPres.getByName("MiPresentacion")
end if
For x = 0 to Count-1
   RndSlide = DPages.getByIndex(RndList(x))
   MyCust.insertByIndex(x, RndSlide)
next x
FirstPage = DPages.getByIndex(RndList(0))
CurrController = oDoc.currentController
CurrController.select(FirstPage)
Presentation = oDoc.Presentation
Presentation.CustomShow = "MiPresentacion"
Presentation.Start()
End Sub
Avatar de Usuario
SLV-es
Mensajes: 4894
Registrado: Jue Ago 26, 2010 1:25 am
Ubicación: España
Contactar:

Re: Presentación aleatorio

Mensaje por SLV-es »

Si con las respuestas obtenidas consideras que se ha dado solución a tu consulta :), por favor, marca el tema como [RESUELTO],
(aunque la solución obtenida sea que no la hay :().
Si no sabes cómo, por favor, lee Como marcar como [RESUELTO] un tema.
Por esta vez lo haré yo; la próxima vez, hazlo tú.
Gracias por participar en el foro y ayudar a que todo esté ordenado.
+info en la web "no oficial" dedicada a OpenOffice en Español
AOO 4.1.2 y LibO 4.4.6 en W10 y en Lliurex
No respondo mensajes privados sobre AOO, por favor, utiliza el foro para tus preguntas
Responder