Events in Base?

Can anyone please direct me to documentation on Events in Base at document level (ie not Control events)? The wiki lists these events but does not explain their context. I am using LO Base v5.2.6.2 on OpenSuSe 13.2 x64.

I have been trying to customise an .odb file, to link macros to document-level events (in Tools->Customise). Although ‘Open document’ does fire on loading, ‘Document is going to be closed’ & ‘Document closed’ don’t fire on closure.

After a lot of trial & error, I have also found that ‘View is going to closed’ is fired on closure of the .obd file, but ‘View closed’ is not. Nor is ‘View Created’ fired on open.

‘Document closed’ is referenced but not explained in the Base Handbook. ‘View’ events are not mentioned. Googling turns up info only on Control events in macros.

Any help or pointers will be greatly appreciated.


I had many of the same questions as you when I started, and so far have never found really great answers to these questions. The documentation is terse at best.

But that being said I have slowly gotten the things to work that I have hoped to do, sometimes just by trial and error. I had some prior experience w/ Access, and that helped. Also checkout the OpenOffice Forum as there are a bunch of good people and posts there.

What I have learned to do is create test subs which report the event and then die (stop), so I can figure out which events to use. The reason I have them die, is because some events put the system into an infinite loop if you’re not careful.

Also are you using MRI or the like? It does give you some info as to what events are hooked up, and how to hook and unhook them. (I’m no expert at that, but hope to learn how to do that more in the future.)

Once the event fires, you can usually also do something like mri oEvent:stop to start to see your object mesh and move around it, and discover things, and generally have a great time, when you’re not scratching your head.

One good reference is the OpenOffice Developer’s guide. It’s huge and in the middle parts is much good stuff that might help you. You can find a link to it in this post of mine here.

Thanks for this, and the link. I use Xray to explore the API, and this is good for events that fire, but doesn’t help with events that don’t.

Like you say, I shall keep hunting around the docs that are out there. I shall also go to the openOffice forum - I’m beginning to realise that OO is not so different to LO at macro level.

FWIW I’ve attached to my question a small .odb with a simple macro that pops up a message box with the name of the event that fired it. I linked this macro to various events listed in Tools->Customise->Events to find out when and if they fire.