Ask Your Question
1

Events in Base?

asked 2017-04-28 20:51:05 +0100

branestawm gravatar image

updated 2017-04-29 00:54:29 +0100

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.

documentclosetest.odb

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2017-04-28 21:35:45 +0100

EasyTrieve gravatar image

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.

edit flag offensive delete link more

Comments

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.

branestawm gravatar imagebranestawm ( 2017-04-29 00:23:55 +0100 )edit

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.

branestawm gravatar imagebranestawm ( 2017-04-29 00:29:43 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-04-28 20:51:05 +0100

Seen: 232 times

Last updated: Apr 29 '17