,
Is it possible to prevent the form from closing in BASIC??
This link is the closest thing that i found
http://www.oooforum.org/forum/viewtopic.phtml?t=22353
Code: Select all
Global oListener as Object
Sub install_listener
oListener = CreateUnoListener("Listensub_", "com.sun.star.util.XCloseListener")
thisComponent.addCloseListener(oListener)
End Sub
Sub Listensub_disposing(oEvent)
msgbox("disposing")
End Sub
Sub Listensub_queryClosing(oEvent, bOwnership)
msgbox("query")
End Sub
Sub Listensub_notifyClosing(oEvent)
msgbox("notify")
End Sub http://api.openoffice.org/docs/common/r ... tener.html
says that
Such close events are broadcasted by a XCloseBroadcaster if somewhere tries to close it by calling XCloseable::close(). Listener can:
* break that by throwing CloseVetoException
* or accept that by deregister himself at this broadcaster.
No idea what "throws" mean
searching for hours, i'm afraid that it really cannot be done in basic (a lot of code that i searched for has try, catch, ...)
Actually , in BASIC is it possible to cancel all events,
like the event "Before record action", if it is not possible to cancel it, then what would be the difference if the macro is attached "After record action", because even if you don't want the "record action" to happen, you don't have any ways of cancelling it.
I don't want to believe that it can't be done...........I'm open to all methods, even it means that i have write something that is not BASIC, i really want to use this openoffice!!
(again in ms access, one can cancel a "before" event easily by typing Cancel=True)
Title Edited. A descriptive title for posts helps others who are searching for solutions and increases your chances of a reply. (TheGurkha, Moderator)