void ReplaceSel( LPCTSTR lpszNewText, BOOL bCanUndo = FALSE );
Parameters
lpszNewText
Pointer to a null-terminated string containing the replacement text.
bCanUndo
To specify that this function can be undone, set the value of this parameter to TRUE. The default value is FALSE.
Remarks
Call this function to replace 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.
For more information, see EM_REPLACESEL in the Win32 documentation.
CRichEditCtrl Overview | Class Members | Hierarchy Chart
See Also CRichEditCtrl::CanUndo, CRichEditCtrl::Undo, CWnd::SetWindowText