I want to get content of a text cursor in Libreoffice Writer. In this case, the content of the first word in the document.
I tried the code below. The last line in the sub gets me the content of the whole document not of the first word. I do not want that. I want the content / string of the first word.
Sub Test4
Cursor = ThisComponent.Text.createTextCursor()
Cursor.gotoStart(False)
Cursor.gotoEndOfWord(True)
msgbox Cursor.Text.getString()
End Sub
The right answer is this.