We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

Macro to update "data source" property on the Writer form of a template

asked 2020-04-22 19:32:28 +0200

Ardee gravatar image

My environment: Windows 10, LibreOffice Version: (x64) HSQLDB Version 2.3.2 Split Database

On the "When Loading" event of a writer template, I pick up the template's location with thisComponent.url from which I can diagnose the location and name of the database I need to reference on the form's "data source" property.

Browsing through documentation I could not find the syntax to place that diagnosed value to the form's "data source" property.

Can someone help please? Thank you

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-04-22 21:40:42 +0200

Ratslinger gravatar image


What may be of great help is the use of MRI (have given you this info in past post).

With a quick test on a standalone Writer form was able to modify the source from one to another using the code generated from MRI:

image description

The code is simple and here used registered database names.

edit flag offensive delete link more


@Ratslinger many thanks, that worked fine. Your pic inspires to get MRI, I know you recommended this extension earlier, when I looked at it then I interpreted that I should get ahead on basic LO usage before moving to extensions and learning yet another package. But I will install and study now, I've already processed a large part of my old vba code meantime. Thank you for your precious help that has allowed me to move ahead more quickly with more result, and in particular, learn from each hurdle and problem solved to better solve the next one

Ardee gravatar imageArdee ( 2020-04-23 00:22:48 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-04-22 19:32:28 +0200

Seen: 69 times

Last updated: Apr 22 '20