Set TabStops in Writer by Macro

Hi all,
With the next macro in Writer I can see in Xray that Style.Paratabstops has three tabstops. But in my docement there are no new tabs.
What am i doing wrong.
I have a reason to do not use the recorded uno:tabstops macro.
Kind regards,
Jan Flikweert
With the next macro in Writer I can see in Xray that Style.Paratabstops has three tabstops. But in my docement there are no new tabs.
What am i doing wrong.
I have a reason to do not use the recorded uno:tabstops macro.
- Code: Select all Expand viewCollapse view
sub ParaTabStops
DIM loDocument AS object
DIM loText as object
DIM loCursor AS object
DIM oStyle AS object
DIM loPara AS object
DIM loenText aS object
DIM arrayObject
loDocument=ThisComponent
oStyle = loDocument.createInstance( "com.sun.star.style.ParagraphStyle" )
oStyle.setName( "My new style")
dim tbstps(2) as new com.sun.star.style.TabStop
tbstps(0).Position = 1500
tbstps(0).Alignment = 0
tbstps(0).DecimalChar = 44
tbstps(0).FillChar = 32
tbstps(1).Position = 4500
tbstps(1).Alignment = 0
tbstps(1).DecimalChar = 44
tbstps(1).FillChar = 32
tbstps(2).Position = 7500
tbstps(2).Alignment = 0
tbstps(2).DecimalChar = 44
tbstps(2).FillChar = 32
oStyle.setPropertyValue( "ParaTabStops", tbstps() )
xray oStyle.paratabstops
loText=loDocument.getText()
loenText = loText.createEnumeration()
loPara = loenText.nextElement()
loPara.ParaStyleName = "Standaard"
loCursor= loText.createTextCursor()
loenText = loText.createEnumeration()
loPara = loenText.nextElement()
loPara.ParaStyleName = "Standaard"
loText.insertString(loCursor,"First line"+Chr(13), false)
loCursor= loText.createTextCursor()
loText.insertString(loCursor,"Second line ", false)
end sub
Kind regards,
Jan Flikweert