Ask Your Question
0

Select whole line with macro

asked 2016-02-21 02:58:53 +0100

Thomaxz2 gravatar image

How can I select the whole line, where the cursors is via macro, so I can manipulate it via macro?

I'am trying to write a macro in Libre Office Wirter, so far it went no problem, but can't figure out how you would tell writer via macro, to select the whole line.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-03-13 12:09:13 +0100

Thomaxz2 gravatar image

By record a macro, with selection throug keyboard and not mouse, I have success

The solutons be this code

   rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:GoToEndOfLine", "", 0, Array())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:StartOfLineSel", "", 0, Array())

rem All Caps
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-02-21 02:58:53 +0100

Seen: 211 times

Last updated: Mar 13 '16