Advertisement
gbc921

Libreoffice Duplicate Line/Row Macro

Jun 10th, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sub rowduplicate
  2. dim document   as object
  3. dim dispatcher as object
  4. document   = ThisComponent.CurrentController.Frame
  5. dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
  6. dim args1(0) as new com.sun.star.beans.PropertyValue
  7. args1(0).Name = "Sel"
  8. args1(0).Value = false
  9. dispatcher.executeDispatch(document, ".uno:GoToStartOfRow", "", 0, args1())
  10. dim args2(0) as new com.sun.star.beans.PropertyValue
  11. args2(0).Name = "Sel"
  12. args2(0).Value = true
  13. dispatcher.executeDispatch(document, ".uno:GoToEndOfRow", "", 0, args2())
  14. dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
  15. dispatcher.executeDispatch(document, ".uno:InsertRows", "", 0, Array())
  16. dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
  17. end sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement