Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. REM ***** BASIC *****
  2.  
  3. Sub NewFile
  4. Dim s$ : s = "private:factory/swriter"
  5. oDoc=StarDesktop.loadComponentFromURL(s,"_blank",0,Array())
  6. End Sub
  7.  
  8. Sub FromatedText
  9. document=ThisComponent
  10. oText = document.Text
  11. Cursor = document.currentcontroller.getViewCursor()
  12. mySelection = oText.createTextCursorByRange(Cursor.getStart())
  13. mySelection.gotoStartOfParagraph(false)
  14. mySelection.gotoEndOfParagraph(true)
  15. mySelection.CharFontName="lato"
  16. mySelection.CharHeight="24"
  17. mySelection.CharColor= RGB(153,153,153)
  18. mySelection.CharPosture = com.sun.star.awt.FontSlant.ITALIC
  19. mySelection.CharWeight = com.sun.star.awt.FontWeight.BOLD
  20. mySelection.CharUnderline = com.sun.star.awt.FontUnderline.SINGLE
  21. End Sub
  22.  
  23. Sub NewTable
  24. Doc = ThisComponent
  25. Cursor = Doc.Text.createTextCursor()
  26. Table = Doc.createInstance("com.sun.star.text.TextTable")
  27. Table.initialize(5, 5)
  28. Doc.Text.insertTextContent(Cursor, Table, False)
  29. End Sub
  30.  
  31. Sub DrawRect
  32. Dim Doc As Object
  33. Dim Page As Object
  34. Dim RectangleShape As Object
  35. Dim Point As New com.sun.star.awt.Point
  36. Dim Size As New com.sun.star.awt.Size
  37. Doc = ThisComponent
  38. Page = Doc.DrawPages(0)
  39. Point.x = 1000
  40. Point.y = 1000
  41. Size.Width = 10000
  42. Size.Height = 10000
  43. RectangleShape = Doc.createInstance("com.sun.star.drawing.RectangleShape")
  44. RectangleShape.Size = Size
  45. RectangleShape.Position = Point
  46. Page.add(RectangleShape)
  47. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement