Get the current paragraph in basic (solved)

Creating a writer document in basic, I output a line at a time with insertString, or take a new paragraph with an append_paragraph character.

When I want to take a new page, I have to set the pageDescName for the current paragraph.

How do I get hold of the current paragraph? All the examples I see find the last paragraph by enumeration and working through all the paragraphs. This is cumbersome when I know that my cursor is already located in the last paragraph. Is there a cursor.paragraph property, or textrange.paragraph property or something like that?

Probably obvious, but I’ve missed it. Help appreciated.

Hello Pansmanser, you might need to get the ViewCursor:

oViewCursor = ThisComponent.CurrentController.getViewCursor()

i think it has the pageDescName property

Thank you librebel, that appears to work fine. In fact the text cursor also seems to have the pageStyleName property and accepts the pageDescName property