Вот и на "родном" SB
Sub Test_Borders
Dim aBorder, oRange, oDoc, oSheets
Dim TableBorder As New com.sun.star.table.TableBorder
Dim aTopLine As New com.sun.star.table.BorderLine
oDoc = ThisComponent
oSheets = oDoc.Sheets(0)
oRange = oSheets.getCellRangeByPosition(0,0,5,5)
aBorder = oRange.TableBorder
aTopLine.OuterLineWidth = 20 ' это толщина внешней линии в случае двойной рамки
aTopLine.InnerLineWidth = 0 ' это толщина внутренней линии в случае двойной рамки
aTopLine.Color = 170000
aBorder.TopLine = aTopLine
aBorder.BottomLine = aTopLine
aBorder.LeftLine = aTopLine
aBorder.RightLine = aTopLine
aBorder.HorizontalLine = aTopLine
aBorder.VerticalLine = aTopLine
for i =1 to 10
oRange = oSheets.getCellByPosition(i,i+1)
oRange.Value = i
oRange.TableBorder = aBorder
'oRange.IsTextWrapped = true
next
End Sub
ps исправил, разкомментировал oRange = oSheets.getCellRangeByPosition(0,0,5,5)