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

Ask Your Question

LibreOffice Base form size not saving

asked 2021-01-22 21:27:01 +0200

mattl gravatar image

I saw several posts on here regarding issues with LibreOffice Base forms not saving the correct size. I upgraded from version 6.1 to 7.0.4 and the issue still persists. It seems the issue has persisted for years, from what I have seen in the forum. And I was not able to get the simple macro to work.

I created the macro under Tools -> Macros -> Organize Macros -> Basic:

Sub fm_FormName thisComponent.currentController.Frame.ContainerWindow.PosSize(100, 100, 100, 100, 15) End Sub

And then in design mode for the form, I assigned the macro: Tools -> Customize -> Events

I tried each the 'Document loading finished', 'Open Document', and 'Activate Document'. None worked and the form continues to open on the entire screen. Please let me know if this has finally been fixed in version 7 (and I'm missing a setting or something). Or if there is a different macro that should be used. Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2021-01-22 22:12:35 +0200

Ratslinger gravatar image

updated 2021-01-22 22:13:49 +0200


There are a few problems with your statement.

PosSize should be setPosSize. Your window size (100x100) is very small and needs to be larger. There is a further bug which hampers the location being set correctly. You need to duplicate the statement and wait between statements. This code will work (attached to Open Document event of the form):

Sub fm_FormName
    thisComponent.currentController.Frame.ContainerWindow.setPosSize(100, 100, 100, 100, 15)
    Wait 200
    thisComponent.currentController.Frame.ContainerWindow.setPosSize(100, 100, 100, 100, 15)
End Sub

For use in multiple forms, see my answer in this post -> Adjust size and placement of a form in Base

edit flag offensive delete link more


BTW this is still an open issue. tdf#115619

Ratslinger gravatar imageRatslinger ( 2021-01-22 22:18:23 +0200 )edit

Awesome. Thank you for clarifying about the second / duplicate statement. With correcting that, and fixing the function call, it's working great - especially at the larger size you suggested. Cheers.

mattl gravatar imagemattl ( 2021-01-22 22:24:16 +0200 )edit


Glad all is working for you.

As you have been helped, please help others to know the question has been answered by clicking on the ✔ in upper left area of answer which satisfied the question.

Ratslinger gravatar imageRatslinger ( 2021-01-22 22:27:25 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2021-01-22 21:27:01 +0200

Seen: 38 times

Last updated: Jan 22