Ask Your Question
0

setting event handler in basic (solved) [closed]

asked 2019-10-22 16:02:26 +0100

Pansmanser gravatar image

updated 2019-10-24 11:35:42 +0100

It is a simple matter to associate a macro with an event using the Tools-Customise menu. Is there an equally simple way to do this from basic? The event handler stuff seems very complicated for something which is so simple by manual means. Specifically I want an impress file to do something when the presentation closes (OnViewClosed).

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by erAck
close date 2019-10-26 16:29:19.210313

1 Answer

Sort by » oldest newest most voted
0

answered 2019-10-22 18:42:30 +0100

Pansmanser gravatar image

I've found the answer to this by modifying pierre-yves' (to whom thanks) code in: https://ask.libreoffice.org/en/questi...

dim Prop(1) as new com.sun.star.beans.PropertyValue
Prop(0).name = "EventType" : Prop(0).value = "Script"
Prop(1).name = "Script"
Prop(1).value = "vnd.sun.star.script:Standard.ImpressModule.ExitStuff?language=Basic& location=document" 
ThisComponent.Events.ReplaceByName("OnViewClosed", Prop())

Simples!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-10-22 16:02:26 +0100

Seen: 20 times

Last updated: Oct 24