End of File for RichEditor

Trying to determine how to figure out when you reach the end of the document in a Rich Editor when trying to go through replacing text throughout the document.

     TMSFMXRichEditor.ReplaceFirst('<code>', '<newcode>')

I also cannot figure out how to set or move the Cursor or Caret position through the document programmatically. I have tried all the Get and Set Caret commands in the PDF Help.

Is Caret the Mouse Position vs Cursor position?

You can use AdvRichEditor.SelStart, AdvRichEditor.SelLength to set the caret & selection programmatically (similar to a regular TMemo)