Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- REM ***** BASIC *****
- Sub NewFile
- Dim s$ : s = "private:factory/swriter"
- oDoc=StarDesktop.loadComponentFromURL(s,"_blank",0,Array())
- End Sub
- Sub FromatedText
- document=ThisComponent
- oText = document.Text
- Cursor = document.currentcontroller.getViewCursor()
- mySelection = oText.createTextCursorByRange(Cursor.getStart())
- mySelection.gotoStartOfParagraph(false)
- mySelection.gotoEndOfParagraph(true)
- mySelection.CharFontName="lato"
- mySelection.CharHeight="24"
- mySelection.CharColor= RGB(153,153,153)
- mySelection.CharPosture = com.sun.star.awt.FontSlant.ITALIC
- mySelection.CharWeight = com.sun.star.awt.FontWeight.BOLD
- mySelection.CharUnderline = com.sun.star.awt.FontUnderline.SINGLE
- End Sub
- Sub NewTable
- Doc = ThisComponent
- Cursor = Doc.Text.createTextCursor()
- Table = Doc.createInstance("com.sun.star.text.TextTable")
- Table.initialize(5, 5)
- Doc.Text.insertTextContent(Cursor, Table, False)
- End Sub
- Sub DrawRect
- Dim Doc As Object
- Dim Page As Object
- Dim RectangleShape As Object
- Dim Point As New com.sun.star.awt.Point
- Dim Size As New com.sun.star.awt.Size
- Doc = ThisComponent
- Page = Doc.DrawPages(0)
- Point.x = 1000
- Point.y = 1000
- Size.Width = 10000
- Size.Height = 10000
- RectangleShape = Doc.createInstance("com.sun.star.drawing.RectangleShape")
- RectangleShape.Size = Size
- RectangleShape.Position = Point
- Page.add(RectangleShape)
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement