Thanks a lot. I found another way:
var editor1 = document.getElementById('CE_Editor_ID');
//Get the editor selection
var editor1doc = editor1.GetDocument();
if (editor1doc.selection=="Text")
{
selectedhtml = editor1doc.selection.createRange().htmlText;
alert(selectedhtml);
}
However function PasteHTML(html) helps only if I want to replace the whole HTML text in editor. How about "replace selected text with my own"? Thank you in advance.