Ask Your Question

Sub and UNO Action combined

asked 2020-04-07 18:05:55 +0200

gkick gravatar image


Is it possible to combine a Sub and an UNO action together in a macro as from the GUI this does not seem to be an option, thank you

edit retag flag offensive close merge delete



Please give more information about what you are trying to do. Perhaps this is about a dispatcher command such as ".uno:Cut". To see a subroutine like that, use the macro recorder in Writer. That is not currently possible in Base, so use the recorded code from Writer in your Base database. Or better yet, look up an example online.

Jim K gravatar imageJim K ( 2020-04-07 19:34:22 +0200 )edit

Hi, I have some forms containing multiple table controls and some buttons at the top to navigate to other forms. If the user moves from a table control to a button to open another form, a macro will open the requested form without loading any data if the user did not save the latest change in the table control. Therefor I d like to change the macro to first save the record and then open the new form. Hope this makes sense, thks

gkick gravatar imagegkick ( 2020-04-08 03:19:24 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-04-10 00:40:52 +0200

Ratslinger gravatar image


As noted already by @Jim K you can lookup a slot on line -> Macro to save record

This seems to work as you want:

document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("")
dispatcher.executeDispatch(document, ".uno:RecSave", "", 0, Array())

You may also want to delve into uno commands. See links in this post -> I need documentation of oDispatcher.executeDispatch

edit flag offensive delete link more


Make certain the button to run this is on the form where the record is to be updated.

Ratslinger gravatar imageRatslinger ( 2020-04-10 06:36:40 +0200 )edit

Thank you gentlemen, much appreciated!

gkick gravatar imagegkick ( 2020-04-11 08:09:16 +0200 )edit

Thank you gentlemen!

gkick gravatar imagegkick ( 2020-04-11 08:31:32 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-04-07 18:05:55 +0200

Seen: 51 times

Last updated: Apr 10