// Access the XText interface of the text contained within the frame
XText xFrameText = xFrame.getText();
// Create a TextCursor over the frame's contents
XTextCursor xFrameCursor = xFrameText.createTextCursor();
// Insert some text into the frame
xFrameText.insertString(
xFrameCursor, "The first line in the newly created text frame.",
false );
xFrameText.insertString(
xFrameCursor, "\nThe second line in the new text frame.", false );
// Insert a paragraph break into the document (not the frame)