Show/Hide Toolbars

EmEditor Help

Navigation: EmEditor Help > Macro Reference > Tutorial

EmEditor Macro Reference: Convert Character in Selection Range

Scroll Prev Top Next More
EmEditor Home - EmEditor Help - EmEditor Macro Reference - Tutorial

Convert Character in Selection Range

To convert characters in Selection Range, add the seventh line to our Tutorial macro:


document.selection.Text = "EmEditor supports macros.";


document.selection.Text = "\tEmEditor is a text editor.";

document.selection.CharLeft( false, 12 );

document.selection.DeleteLeft( 15 );

document.selection.CharRight( true, 9 );

document.selection.ChangeCase( eeCaseUpperCase );


document.selection.Text = "EmEditor supports macros."


document.selection.Text = Chr(9) & "EmEditor is a text editor."

document.selection.CharLeft False, 12

document.selection.DeleteLeft 15

document.selection.CharRight True, 9

document.selection.ChangeCase eeCaseUpperCase

Save the above macro and run it in a new EmEditor window. Notice that the characters of the selected text have converted to upper case:


ChangeCase Method takes an argument that specifies whether characters are to be converted to upper case or lower case.

Similarly, the following methods are provided to convert characters in Selection Range. For further details, such as explanations of arguments that methods take, refer to each method.


Convert characters to upper or lower case.


Convert characters to half-width or full-width characters.


Insert a newline character at a line wrap position of the selection range or delete a newline.


Indent the section specified by the selection range.


Convert spaces to tabs in the selection range.


Unindent the section specified by the selection range.


Convert tabs to spaces in the selection range.

Next Topic:

q Find in Files

Copyright © 2003-2021 by Emurasoft, Inc.