Where can I find Documentation of Terms in Macros

I have written hundreds of macros in Word, and read Michael Pitonyak’s excellent book.
However I am mystified at what many of the terms that show up in a macro that results from recording the macro below to increase the space before a paragraph to 0.2cm. Pityonyak’s book explains statements, functions and structures of Basic, but not terms like those I have put in Bold (ie triple ***) in the Macro below.
I’m not asking you to explain all these terms in a response, but tell me where I can find documentation of them and how to know what to include when writing a macro myself.

Thanks

sub ParagraphSpaceAbove1
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim ***dispatcher*** as object

rem ----------------------------------------------------------------------

rem get access to the document

document = .***CurrentController***.***Frame***

dispatcher = ***createUnoService("com.sun.star.frame.DispatchHelper"***)

rem ----------------------------------------------------------------------

dim ***args1(4) as new com.sun.star.beans.PropertyValue***

***args1(0).Name*** = "TopBottomMargin.TopMargin"

***args1(0).Value*** = 199  ***HOW DOES 0.2CM BECOME 199***

args1(1).Name = "TopBottomMargin.BottomMargin"

args1(1).Value = 0

args1(2).Name = "TopBottomMargin.ContextMargin"

args1(2).Value = false

args1(3).Name = "***TopBottomMargin.TopRelMargin***"

args1(3).Value = 100

args1(4).Name = "TopBottomMargin.BottomRelMargin"

args1(4).Value = 100

***dispatcher.executeDispatch(document, ".uno:TopBottomMargin", "", 0, args1())***

rem ----------------------------------------------------------------------

dim ***args2(0) as new com.sun.star.beans.PropertyValue***

***args2(0).Name = "NumberingStart"***

***args2(0).Value = false***

***dispatcher.executeDispatch(document, ".uno:NumberingStart", "", 0, args2())***

rem ----------------------------------------------------------------------

***dim args3(0) as new com.sun.star.beans.PropertyValue***

***args3(0).Name = "NumNewStartAt"***

***args3(0).Value = 65535***

***dispatcher.executeDispatch(document, ".uno:NumNewStartAt", "", 0, args3())***

end sub

Perhaps some of the links in I need documentation of oDispatcher.executeDispatch - #15 by Lupp may be helpful.

1 Like

Internal unit is (often) mm/100 but there is also rounding from twips:

1 Like

not how to use “dispatcher code”. This is the way how internal commands from the menues were realized. At a later stage some people created a macro recorder, because it can be useful. But this creates no API code as described in the book.
.
The usual advice is: Avoid this in your own macros. (But I have some old search-and-replace macros still in use…)

1 Like

I wrote LibreOffice Developer Search for command line searhing for API and other searches.

For loapi commands when you press the corresponging number next to the result it will open the LibreOffice API page for the result. I use this a lot when I am working on developing OOO Development Tools (OooDev). Especially for looking up imports.

loapi comp --search writer
Choose an option (default 1):
[0],  Cancel
[1],  UnsupportedOverwriteRequest       - com.sun.star.task.UnsupportedOverwriteRequest           - exception
[2],  LayerWriter                       - com.sun.star.configuration.backend.xml.LayerWriter      - service
[3],  ManifestWriter                    - com.sun.star.packages.manifest.ManifestWriter           - service
[4],  Writer                            - com.sun.star.xml.sax.Writer                             - service
[5],  XCompatWriterDocProperties        - com.sun.star.document.XCompatWriterDocProperties        - interface
[6],  XManifestWriter                   - com.sun.star.packages.manifest.XManifestWriter          - interface
[7],  XSVGWriter                        - com.sun.star.svg.XSVGWriter                             - interface
[8],  XWriter                           - com.sun.star.xml.sax.XWriter    

There are other search commands as well to make life a little easier, lodoc and loguide.

As for the the units, It is not always a straight forward what units are being used. As @Wonderer mentioned it is often 1/100th mm Although Dialogs use an AppFont unit for the model and a pixel unit for the views.

For OooDev I wrote many Units that can convert to other units. Also there is the convert class that can handle most conversion.

This is for python and may not help you directly but I mention it becuause you may benfiit understanding how to convert your macros from one unit to another so you don’t end up with unexpected number values that are not overly useful.

1 Like