Show/Hide Toolbars

EmEditor Help

Navigation: EmEditor Help > Macro Reference > Editor Object > Methods

EmEditor Macro Reference: ExecuteMacro Method

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

ExecuteMacro Method

Executes a specified macro.

[JavaScript]

nResult = editor.ExecuteMacro( strMacroFileName, nFlags );

[VBScript]

nResult = editor.ExecuteMacro( strMacroFileName, nFlags )

Parameters

strMacroFileName

Specifies the path and file name of the macro file you want to run, or a macro text on memory that you want to run.

nFlags

Specifies a combination of the following values.

eeRunFile

The strMacroFileName parameter specifies the path and file name of the macro file.

eeRunText

The strMacroFileName parameter specifies a macro text on memory.

eeMacroLangJScript

The macro is JavaScript.

eeMacroLangVBScript

The macro is VBScript.

Return Values

The return value is not used.

Examples

[JavaScript]

editor.ExecuteMacro( "E:\\Macros\\Macro.jsee", eeRunFile | eeMacroLangJScript );

editor.ExecuteMacro( "alert('Hello')", eeRunText | eeMacroLangJScript );

[VBScript]

editor.ExecuteMacro "E:\Macros\Macro.jsee", eeRunFile Or eeMacroLangJScript

editor.ExecuteMacro "alert('Hello')", eeRunText Or eeMacroLangJScript

Version

Supported on EmEditor Professional Version 17.0 or later.

Copyright © 2003-2019 by Emurasoft, Inc.