How to set inner vertical double border line in macro?

How? W/o dispatcher.
Does not work (target range is previously selected):

Sub SetBorderInnerVertical()
	Dim document As Object
	Dim dispatcher As Object

	document = ThisComponent.CurrentController.Frame
	dispatcher = createUnoService("")

	Dim args(4) as new
	args(0).Name = "BorderInner.Horizontal"
	args(0).Value = Array(0, 0, 0, 0, 0, 0)
	args(1).Name = "BorderInner.Vertical"
	args(1).Value = Array(0, 18, 18, 4, 15, 2)
	args(2).Name = "BorderInner.Flags"
	args(2).Value = 2
	args(3).Name = "BorderInner.ValidFlags"
	args(3).Value = 127
	args(4).Name = "BorderInner.DefaultDistance"
	args(4).Value = 0

	dispatcher.executeDispatch(document, ".uno:BorderInner", "", 0, args())
End Sub


oBorder = CreateUnoStruct("")
oBorder.LineStyle =

Range props: LeftBorder, TopBorder, RightBorder, BottomBorder. There is no InnerBorder…
What is analog of dispatcher’s BorderInner arg: Name = “BorderInner.Vertical” ?

Try to change in Range props: TableBorder.HorizontalLine and TableBorder.VerticalLine.
I set inner border manually in selected range and then xray for selection, and this properties were changed.

Properties can not be set directly, you must first configure the data structure (of which there are two: TableBorder2, BorderLine2, one nested in the other), and then assign it to a property of the data range. See @karolus example.

I wasn’t sure what you mean by the term inner border, so I supposed it is these lines created manually (red color):

Then I only ran Xray on selected cells
and tried to find the other properties than LeftBorder, TopBorder, RightBorder, BottomBorder

I have for example this macro, but I hadn’t time (and mood and willpower :-() to make&test a changes:

Sub calcCellsBorderColor
	dim oDoc as object, oSheet as object, oRange as object, oBorder as new
	oDoc=StarDesktop.LoadComponentFromUrl("private:factory/scalc", "_default", 0, array())
	with oBorder
		.Color=RGB(200, 0, 150)
	end with
	rem apply properties to the Range is faster than cell by cell
	oRange=oSheet.getCellRangeByPosition(1, 1, 3, 3)
End Sub
  1. Dont use wild guess from ugly recorded code.
  2. use Releases · hanya/MRI · GitHub for Objectinspection
  3. use serious Programminglanguages
from import TableBorder2
from import BorderLine2

def red_fat_inner_vertical(*_):

    tableborder = TableBorder2()
    border = BorderLine2()
    doc = XSCRIPTCONTEXT.getDocument()
    sel = doc.CurrentSelection

    border.Color = int('ff0000',16)
    border.OuterLineWidth = 106
    tableborder.IsVerticalLineValid = True
    tableborder.VerticalLine = border
    sel.TableBorder2 = tableborder

border.LineStyle = '15