Hello,
I’d like to get the content of a document, from the begining of the document until the cursot position.
For now here’s what I have :
' Get cursor current position
cursor = ThisComponent.CurrentController.getViewCursor()
cursorPrevPos = cursor.Start
' Get all the text before the cursor
' Here I don't know how to do...
' Go back to cursor position
cursor.goToRange(cursorPrevPos, false)
As you can see, first I memorise the current cursor position because at the end I will need to place it where is initially was.
Then I need to retrieve the content of the document, from the 1st letter until the cursor position.
Not only I need to get the text, but more importantly, the fields. I actually don’t need the text but just the fields.
Then I will have to do some treatment, and at the end, the cursor will be placed where it was.
Can you tell me how I can get the content of the document between 0 to cursor position ?