Help getting started with LibreOffice Basic


I want to be able to open a document in LibreOffice Writer, get a pop-up dialog asking for some information (line edits, a combobox, two radio buttons and a multi line edit). This information should then be inserted into the document (for the combobox and the radio buttons it should choose between different text versions).

I think this should be rather simple, and perhaps it’s because of that that I haven’t found any useful information or tutorials on the theme.
I have found this page with a lot of information, but it seems to be a bit to much.

I have experience programming in C++, including creating GUIs, so I know the absolute basics.

Thanks in advance,

Do you really want a macro? You can get any data with this method or so

The problem is I may need to insert the texts at multiply places, but I only want to edit it once.

Do you dowload demo from previous link “so”?

How would I go about adding a two radio buttons or similar? And a combobox? Other than that it looks perfect.

Well, Jan, I think it is a good place to start would be chapters “10. Forms” и " 7.14. Search And Replace" of THIS BOOK by Andrew Pitonyak. And macro and dialog in this workbook

@Jan1 – still looking for an answer here?

@JohnSUN – could you please turn your comment into an answer so we could use it for resolution?


I am providing this answer so that this old question can be closed. As @JohnSUN has pointed out a good place to begin learning about programming in Basic is from the works of Andrew Pitonyak. A link to his web page and several other related programming resources can be found on TDF Wiki Documentation / Other page, under the section for Programmers.

Because I am thoroughly sick of finding OOo/LO material locked away in Scribd I am uploading some related Basic programming Guides here for everyone. If these are still publicly available I would appreciate someone pointing me to the appropriate location.

Please note that

  • OOo v3.4 Basic Programmers Guide is identical to the 3.2 BASIC Guide linked from the wiki’s resources, except that it replaced 3.2 BASIC Guide with LibreOffice 3.4 Basic Programmer’s Guide, which is utterly wrong in itself. You can spare yourself the download.
  • LO v3.4-3.5 Basic Guide (review copy) is nothing official, specifically not produced nor published by TDF and thus wrongly uses the LibreOffice logo with the The Document Foundation subline.