Users have asked for the ability to "centralise all text on a page vertically" - see [Issue] [Workaround] Center text on page vertically. This cannot be done in AOO (MS Office does it) but an easy workaround is with a macro to insert a frame and centre it vertically with respect the page. The sequence is:
Insert > Frame > Type ...
- set Width to Relative, 100%.
- set Position > Vertical to Centre to Entire page.
...
When I record a macro to do this I get as below, where the vertical (Y) position (of the anchor? of the frame?) is set to " 0 ", and the frame is inserted at the top of the page. I tested with a picture and, again, the picture is inserted at the top of the page.
Q1 How do I edit the macro to position the frame vertically?
Q2 Where can I find the specs of the expressions, their arguments and values used in macros so I don't have to ask next time?
Code: Select all
sub z_vert_centre
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(4) as new com.sun.star.beans.PropertyValue
args1(0).Name = "AnchorType"
args1(0).Value = 0
args1(1).Name = "Pos.X"
args1(1).Value = 0
args1(2).Name = "Pos.Y"
args1(2).Value = 0
args1(3).Name = "Size.Width"
args1(3).Value = 17000
args1(4).Name = "Size.Height"
args1(4).Value = 499
dispatcher.executeDispatch(document, ".uno:InsertFrame", "", 0, args1())
end sub