Hi Olivier
Sorry for the delay: holiday out of connection
I do not know of any specific API method. So I would proceed as follows (memorize the section, insert the paragraph, delete the section, restore the section)
sub AltEnter
dim oDoc as object, oText as object, oCursor as object, oSection as object
dim PB as integer
dim avant as object
PB =com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK
oDoc = thiscomponent
oText = oDoc.Text
oSection = oDoc.textSections.getByName("pys1")
avant = oSection.anchor
oCursor = oText.createTextCursorByRange(oSection.Anchor.end)
oText.insertControlCharacter(oCursor, PB, false)
oSection.dispose
oSection = oDoc.createInstance("com.sun.star.text.TextSection")
oSection.attach(avant)
end sub
Best regards