Ask Your Question
0

Select whole line with macro [closed]

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 reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-09-01 13:58:59.030946

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

Question Tools

1 follower

Stats

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

Seen: 357 times

Last updated: Mar 13 '16