TMSFMXRichEditor Move to End

I can't seem to figure out how to move to the end of a document. I tried the following but it doesn't bring the caret to the very end.

        P := TMSFMXRichEditor1.LastElement.XY;
        TMSFMXRichEditor1.Caret.XY := P;
        TMSFMXRichEditor1.XYToCaret(p.X,p.Y+1,false, J);

Any suggestions appreciated. thank you

You can do this with:

  TMSFMXRichEditor1.Caret.Element := TMSFMXRichEditor1.LastElement;
  TMSFMXRichEditor1.Caret.CharIndex := Length(TMSFMXRichEditor1.LastElement.Text);

An alternative is:


TMSFMXRichEditor1.GotoTextEnd;

and this will also scroll to the end of the document.