Automating FormatColumns

Writing a book, Automating Document Production - Discuss your special needs here

Automating FormatColumns

Postby mplaut » Thu Sep 10, 2015 12:33 am

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
mplaut
 
Posts: 23
Joined: Thu May 06, 2010 12:41 am

Re: Automating FormatColumns

Postby Zizi64 » Thu Sep 10, 2015 8:35 am

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; LO6.1.6 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.5; AOO4.1.6
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.
User avatar
Zizi64
Volunteer
 
Posts: 8152
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary


Return to Advanced Uses

Who is online

Users browsing this forum: Horse and 1 guest