Page 1 of 1

Automating FormatColumns

PostPosted: Thu Sep 10, 2015 12:33 am
by mplaut
I wanted to record a macro to format selected text as 2 columns (with a .20 gutter). When I recorded the macro, the result had the function call as a comment (rem dispatcher.executeDispatch(document, ".uno:FormatColumns", "", 0, Array())), and it had not recorded the arguments.

When I uncommented the line, running the macro opened the dialog box. I looked around and could not find documentation for the FormatColumns function call.

1) Is it possible to send FormatColumns arguments and have it execute without opening the dialog box?
2) Is there any documentation for what the arguments are? (I tried using the labels in the dialog box and it just opened the dialog box also.)

Re: Automating FormatColumns

PostPosted: Thu Sep 10, 2015 8:35 am
by Zizi64
1.: The usage of the Macrorecorder is not efficient method for programming the Calc application.
You need study the API (application Programming Interface), the StarBasaic (or other built-in programming language, and you need use them.

2.: Use Styles (in this case: Cell styles) instead of direct formatting. You can apply the existing (created) styles manually, or by your macro.