This bit of code puzzles me. I must have omitted some UNO stuff
What it does is create the custom sized page, insert the text, and then change the tabs.
¡nonono!
what I want it to do is create the custom sized page, change the tabs, and THEN insert the text.
Please can someone point me to the bit of code that needs adding? Thanks.*
Code: Select all
Sub SetPageSize
oDoc = ThisComponent
oStyle = oDoc.StyleFamilies.getByName("PageStyles").getByName("Default")
' units of 1/1000 cm
oStyle.Width = 21000
oStyle.Height = 10000
viewCursor = oDoc.currentController.getViewCursor()
oCursor = oDoc.Text.createTextCursorByRange(viewCursor.getStart())
' add tab stop
Dim tab(0 to 3) as new com.sun.star.style.TabStop
tab(0).Alignment = com.sun.star.style.TabAlign.RIGHT
tab(0).DecimalChar = ASC(".")
tab(0).Position = 5950
tab(1).Alignment = com.sun.star.style.TabAlign.LEFT
tab(1).Position = 7010
tab(2).Alignment = com.sun.star.style.TabAlign.LEFT
tab(2).Position = 8310
tab(3).Alignment = com.sun.star.style.TabAlign.RIGHT
tab(3).DecimalChar = ASC(".")
tab(3).Position = 16540
oCursor.ParaTabStops = Array(tab(0), tab(1), tab(2), tab(3))
insertText("\tthis is an experimental text")
addParagraph("\tXXXX")
End Sub
David.
* Sorry again! I have to do it this way, otherwise I can't defer the db name to run time. Templates and styles are too high level for this. Thought I should mention.