Replaces the current selection in this CRichEditCtrl object with the specified text.
To replace all the text in this CRichEditCtrl object, use CWnd::SetWindowText.
If there is no current selection, the replacement text is inserted at the insertion point, that is, the current caret location.
This function will format the inserted text with the existing character formatting. When replacing the entire range of text (by calling SetSel(0,-1) before calling ReplaceSel), there is an end of paragraph character that retains the previous paragraph's formatting, which in inherited by the newly inserted text.
For more information, see EM_REPLACESEL in the Windows SDK.