Hi,

I am using OO 2.0.4. I tried to record the macro and used the Format-> Cells -> 
border and save the macro and run the macro. It only show the outer border.
I tried to record again and not using the Format ->Cells, but used the icon on 
the menu bar. and save the macro. It works.
So there must be a bug.
Anyway, here is my recorded macro.

rgds,



sub borderIt
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(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$C$7"

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

rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$C$7:$E$12"

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

rem ----------------------------------------------------------------------
dim args3(12) as new com.sun.star.beans.PropertyValue
args3(0).Name = "OuterBorder.LeftBorder"
args3(0).Value = Array(0,0,2,0)
args3(1).Name = "OuterBorder.LeftDistance"
args3(1).Value = 0
args3(2).Name = "OuterBorder.RightBorder"
args3(2).Value = Array(0,0,2,0)
args3(3).Name = "OuterBorder.RightDistance"
args3(3).Value = 0
args3(4).Name = "OuterBorder.TopBorder"
args3(4).Value = Array(0,0,2,0)
args3(5).Name = "OuterBorder.TopDistance"
args3(5).Value = 0
args3(6).Name = "OuterBorder.BottomBorder"
args3(6).Value = Array(0,0,2,0)
args3(7).Name = "OuterBorder.BottomDistance"
args3(7).Value = 0
args3(8).Name = "InnerBorder.Horizontal"
args3(8).Value = Array(0,0,2,0)
args3(9).Name = "InnerBorder.Vertical"
args3(9).Value = Array(0,0,2,0)
args3(10).Name = "InnerBorder.Flags"
args3(10).Value = 0
args3(11).Name = "InnerBorder.ValidFlags"
args3(11).Value = 127
args3(12).Name = "InnerBorder.DefaultDistance"
args3(12).Value = 0

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


end sub

Reply via email to