Basic - where to find help programming macros?


I often find it difficult to find help programming macros in Basic. Things like a list of available properties and methods. What is the property for the backgroundcolor of a control? Is it backgroundcolor, or backcolor, or controlbackcolor, or something else still? In msoffice i find my answers on MSDN or by browsing through the available options in code completion, which displays a list of all available properties and methods. As far as I know, LO doesn’t have code completion, so what are my options in LO?

Also code examples. I just posted an embarrassingly simple question on how to loop through cells in Calc, but I couldn’t find the answer myself on google or on forums. Maybe I asked the wrong question, or maybe I searched in the wrong place. I found one example of a “for each” loop, but when I tried it I got the cryptic message “wrong data type”. But then I don’t know where to find out what the proper data type is?

I clearly need help on where to find help…


Try Macros Explained by Andrew Pitonyak. You might also find an object inspector such as MRI a useful tool. There is a tutorial on MRI here.

Some further topics can be found by searching macro documentation in the search bar above.

If this answer helped you, please accept it by clicking the check mark :heavy_check_mark: to the left and, karma permitting, upvote it. That will help other people with the same question.

In case you need clarification, edit your question (not an answer) or comment the relevant answer.

Andrew Pitonyak’s site also has a collection of links to resources on OOo Basic (some of them, unfortunately, are dead):

thanks everyone for the suggestions, i’ll have a look.
@robleyd: are you sure MRI is still working? I cant install it on LO on linux. I get a cryptic runtimexception regarding some pythonloader: ( { { Message = “<class ‘SyntaxError’>: invalid syntax (, line 21), traceback follows\X000a File “/opt/libreoffice6.2/program/”, line 149, in writeRegistryInfo\X000a mod = self.getModuleFromUrl( locationUrl )\X000a File “/opt/libreoffice6.2/program/”, line 102, in getModuleFromUrl\X000a codeobject = compile( src, encfile(filename), “exec” )\X000a\X000a”, Context = ( @0 } }

I’ve always found this site very useful, with a load of examples