Automating FormatColumns

Writing a book, Automating Document Production - Discuss your special needs here
Locked
mplaut
Posts: 27
Joined: Thu May 06, 2010 12:41 am

Automating FormatColumns

Post 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.)
M Plaut
Openoffice 4.1.4 on Windows 10
User avatar
Zizi64
Volunteer
Posts: 11361
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Automating FormatColumns

Post 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.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Locked