Show/Hide Toolbars

EmEditor Help

Navigation: EmEditor Help > Macro Reference > Selection Object > Properties

Macro: Mode Property

Scroll Prev Top Next More
EmEditor Home - EmEditor Help - EmEditor Macro Reference - Selection Object

Mode Property

Sets or retrieves a flag indicating the selection mode.


nMode = document.selection.Mode;

document.selection.Mode = nMode;


nMode = document.selection.Mode

document.selection.Mode = nMode



Specifies a combination of the following values: However, eeModeStream, eeModeLine, and eeModeBox cannot be combined. Only eeModeKeyboard can be combined with eeModeStream, eeModeLine, or eeModeBox.  When setting the property, eeModeSelected will be ignored.


Stream selection mode.


Line selection mode.


Vertical selection mode.


A mask to inspect the selection mode. Cannot use to set the property. To inspect the Mode Property, use an AND operator and compare the result with eeModeStream, eeModeLine, and eeModeBox.


Specifies the keyboard selection mode. This value can be combined with another value.


Selection is not empty. Valid only when retrieving the property.



nMode = document.selection.Mode;

switch( nMode & eeModeMask ) {

case eeModeStream:

   alert( "Stream selection mode.");


case eeModeLine:

   alert( "Line selection mode." );


case eeModeBox:

   alert( "Vertical selection mode.");



if( nMode & eeModeKeyboard )  alert( "And also the keyboard selection mode." );


nMode = document.selection.Mode

Select Case nMode And eeModeMask

Case eeModeStream

   alert "Stream selection mode."

Case eeModeLine

   alert "Line selection mode."

Case eeModeBox

   alert "Vertical selection mode."

End Select

If nMode And eeModeKeyboard Then

   alert "And also the keyboard selection mode."

End If


Supported on EmEditor Professional Version 4.00 or later. However, EmEditor Professional Version 5.00 or later supports eeModeSelected, and this property returns selection mode even when the selection is empty.

Copyright © 2003-2022 by Emurasoft, Inc.