#19442
Yutaka Emura
Keymaster

Hello,

You can use the following code to check whether the selection exists…

// check whether selection exists
if( !document.selection.IsEmpty() ) {
   // selection exists
   document.seleciton.Replace( ... );
}