Common: Missing Application Events in "Tools:Customize:Events" tab for LibreOffice

I just noticed that the "Start Application" and "Close Application" events are not listed anymore in the "Tools:Customize:Events" tab.
Likewise it appears that some other Application events are also missing ( see screenshot ).

In my previous versions of LibreOffice the “Start Application” and “Close Application” events used to be available, my current version is 5.3.1.2.

  1. Is this normal for version 5.3.1.2 running on Ubuntu 17.04 ?
  2. How can i get the “Start Application” and “Close Application” events back into the Event list ?

Thanks in advance, lib.

EDIT 2017-09-14 Further findings:

  • At this moment, the “Start Application” and “Close Application” events are still missing from the list of events on the dialog “Tools : Customize… : Events ( LibreOffice )”.
    The event names for these two events are stated here as “OnStartApp” and “OnCloseApp” respectively.

  • The same two events ( “OnStartApp” and “OnCloseApp” ) are also missing from the list of events returned by the GlobalEventBroadcaster’s function getEvents().getElementNames().

  • However, when i programmatically assign a script to the “OnStartApp” event using the GlobalEventBroadcaster’s function getEvents().replaceByName(), then

    • .getEvents().hasByName( “OnStartApp” ) returns True,
    • .getEvents().getByName( “OnStartApp” ) returns a property set containing the correct script uri that i assigned,
    • and the assigned script is succesfully called when the application starts.

    Yet after assigning the script in this way, it is still not listed in .getElementNames() nor in the GUI.

EDIT 2

i could set the application event using this macro:

set_Application_Event( "OnStartApp", "Standard", "LibreOffice", "Open_Most_Recent_Document" ) 

Sub set_Application_Event( sEventName as String, sLibrary As String, sModule As String, sFunction As String )
REM Connects the specified Application Event to the specified Basic macro.
REM <sEventName>: The Name of the Application Event to connect a macro to.
REM <sLibrary>	: The Name of the Library that contains the module <sModule>.
REM <sModule>	: The Name of the Module that contains the method <sFunction>.
REM <sFunction>	: The Name of the Method to be connected to the specified Application Event.

	Dim aProps(1) As New com.sun.star.beans.PropertyValue
	aProps(0).Name		= "EventType"
	aProps(0).Value		= "Script"
	aProps(1).Name		= "Script"
	aProps(1).Value		= "vnd.sun.star.script:" & sLibrary & "." & sModule & "." & sFunction & "?language=Basic&location=application"
	
	Dim oGlobalEventBroadcaster As Object
	oGlobalEventBroadcaster = GetDefaultContext().getByName( "/singletons/com.sun.star.frame.theGlobalEventBroadcaster" )
	oGlobalEventBroadcaster.Events.replaceByName( sEventName, aProps() )
	msgbox sEventName & " connected to: " & oGlobalEventBroadcaster.Events.getByName( sEventName )(1).Value, 64, "Set Application Event"
End Sub

@librebel You’re only missing the start & close application. Sorry, using 5.3.4.2 here on Mint 18.2 & all OK. Checked my Ubuntu 16.04 but turns out I got rid of distro version.

Thank you for this info @Ratslinger

i was comparing from this list by mr. Pitonyak, it seems he had more events available back in 2011 besides OnStartApp and OnCloseApp also OnPageCountChange OnMailMerge OnMailMergeFinished OnFieldMerge OnFieldMergeFinished and OnLayoutFinished

@librebel I was comparing your list to one in Calc. In writer there are more. They are: Printing of form letters started, Printing of form letters finished, Merging of form fields started, Merging of form fields finished, & Changing the page count.

@librebel Trying, but so far no luck. Ubuntu 16.04 & Unity for this. Removed LO from LibreOffice. Installed Writer & Calc through Ubuntu software. This gave me v5.1.6.2 & no problems with events listed. Then updated PPA sudo add-apt-repository ppa:libreoffice/ppa & got updated version. This brought me to v5.4.1.2 and still no missing items in events. At this point I’d have to say it’s something with 17.04 and/or where your version is coming from. Lost unless you think of something.

Thank you for your efforts @Ratslinger. I think i’ll wait it out till the next version, now that i found a way to set the event by macro, it’s good enough for me.

And thank you right back for the code. Even with all the events present I can see some use for this. +1!