Ask Your Question
1

script: RowHeight without Dialog

asked 2017-02-21 10:49:05 +0100

kex gravatar image

updated 2017-02-21 11:01:46 +0100

Hello.

I wanna automate my job, so:

  1. when i used the libreoffice version less 5.3 i had a scripts, but when i installed version 5.3 my scripts disappeared
  2. in 5.3 i recorded a new script, but now it doesnt work not correct. Early after running a scripts i had a rows where height was 1cm as result (without any additional windows appear).

In 5.3 after running the script i have a window where i can choose height of row. How fix the script that it won't produce a dialogbox of height of row and the heigth of row will be 1 cm.

ps: script recorded by LO 5.3

sub test2
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(12) as new com.sun.star.beans.PropertyValue
args1(0).Name = "OuterBorder.LeftBorder"
args1(0).Value = Array(0,0,2,0,0,2)
args1(1).Name = "OuterBorder.LeftDistance"
args1(1).Value = 0
args1(2).Name = "OuterBorder.RightBorder"
args1(2).Value = Array(0,0,2,0,0,2)
args1(3).Name = "OuterBorder.RightDistance"
args1(3).Value = 0
args1(4).Name = "OuterBorder.TopBorder"
args1(4).Value = Array(0,0,2,0,0,2)
args1(5).Name = "OuterBorder.TopDistance"
args1(5).Value = 0
args1(6).Name = "OuterBorder.BottomBorder"
args1(6).Value = Array(0,0,2,0,0,2)
args1(7).Name = "OuterBorder.BottomDistance"
args1(7).Value = 0
args1(8).Name = "InnerBorder.Horizontal"
args1(8).Value = Array(0,0,2,0,0,2)
args1(9).Name = "InnerBorder.Vertical"
args1(9).Value = Array(0,0,2,0,0,2)
args1(10).Name = "InnerBorder.Flags"
args1(10).Value = 0
args1(11).Name = "InnerBorder.ValidFlags"
args1(11).Value = 127
args1(12).Name = "InnerBorder.DefaultDistance"
args1(12).Value = 0
dispatcher.executeDispatch(document, ".uno:SetBorderStyle", "", 0, args1())

rem -----
dispatcher.executeDispatch(document, ".uno:RowHeight", "", 0, Array())

rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "VerticalJustification"
args3(0).Value = 2
dispatcher.executeDispatch(document, ".uno:VerticalJustification", "", 0, args3())

rem ---------
dim args4(2) as new com.sun.star.beans.PropertyValue
args4(0).Name = "FontHeight.Height"
args4(0).Value = 8
args4(1).Name = "FontHeight.Prop"
args4(1).Value = 100
args4(2).Name = "FontHeight.Diff"
args4(2).Value = 0
dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, args4())

rem ---------
dim args5(4) as new com.sun.star.beans.PropertyValue
args5(0).Name = "CharFontName.StyleName"
args5(0).Value = ""
args5(1).Name = "CharFontName.Pitch"
args5(1).Value = 2
args5(2).Name = "CharFontName.CharSet"
args5(2).Value = 0
args5(3).Name = "CharFontName.Family"
args5(3).Value = 5
args5(4).Name = "CharFontName.FamilyName"
args5(4).Value = "Verdana"
dispatcher.executeDispatch(document, ".uno:CharFontName", "", 0, args5())

end sub
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2017-02-21 11:32:37 +0100

karolus gravatar image

Create a cellstyle with the your setting and apply simply the Cellstyle instead running this mess.

its not necessary to invoke makros for that task

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-02-21 10:49:05 +0100

Seen: 73 times

Last updated: Feb 21 '17