Select whole line with macro

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.

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