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("com.sun.star.frame.DispatchHelper")

	Dim args(4) as new com.sun.star.beans.PropertyValue
	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

Demo:

oBorder = CreateUnoStruct("com.sun.star.table.BorderLine2")
oBorder.LineStyle = com.sun.star.table.BorderLineStyle.DOUBLE

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
img2
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 com.sun.star.table.BorderLine
	oDoc=StarDesktop.LoadComponentFromUrl("private:factory/scalc", "_default", 0, array())
	oSheet=oDoc.Sheets(0)
	with oBorder
		.Color=RGB(200, 0, 150)
		.OuterLineWidth=40
	end with
	rem apply properties to the Range is faster than cell by cell
	oRange=oSheet.getCellRangeByPosition(1, 1, 3, 3)
	oRange.TopBorder=oBorder
	oRange.BottomBorder=oBorder
End Sub
  1. Dont use wild guess from ugly recorded code.
  2. use Releases · hanya/MRI · GitHub for Objectinspection
  3. use serious Programminglanguages
from com.sun.star.table import TableBorder2
from com.sun.star.table 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 = com.sun.star.table.BorderLineStyle.DOUBLE_THIN '15