Impress running macro

Discuss the presentation application
Post Reply
NZ Jim
Posts: 1
Joined: Mon Jun 07, 2010 10:29 pm

Impress running macro

Post by NZ Jim »

I am going to run Impress for a display at a local club. With a slide show running in auto is it possible to trigger a macro each time the slide changes? I would like to use the output pins from the parallel port to operate lights highlighting different parts of the display as the show runs. I am NOT a programmer, but am willing to try writing a macro.
Thanks,
Jim
OpenOffice 2.4 on Ubuntu 8.04
FJCC
Moderator
Posts: 9365
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Impress running macro

Post by FJCC »

Yes, a macro can be triggered each time a slide transition happens. There is a SlideShowListener that can be added to the slide show and it will respond to a variety of events. You can see the kinds of events in the names of the sub routines. Here is some simple code that just prints "Slide Transition Started" for each slide.

Code: Select all

Sub addListener
Doc = ThisComponent
Presentation = Doc.Presentation
Listener = createUnoListener("EV_","com.sun.star.presentation.XSlideShowListener")
Presentation.Start()
Controller = Presentation.Controller
Controller.addSlideShowListener(Listener)

end sub

Sub EV_paused(oEv)
End Sub

Sub EV_resumed(oEv)
End Sub

Sub EV_slideTransitionStarted(oEv)
Print "Transition Started"
End Sub

Sub EV_slideTransitionEnded(oEv)
End Sub

Sub EV_slideAnimationEnded(oEv)
End Sub

Sub EV_slideEnded(oEv)
End Sub

Sub EV_hyperLinkClicked(oEv)
End Sub

Sub EV_disposing(oEv)
End Sub
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Post Reply