MacroName$()

Syntax

MacroName$(Count [Context] [All] [Global])

Remarks

Returns the name of the macro defined in the specified context.

Argument

Explanation

Count

A number representing a position in the internal list of macros in the given context. Unlike lists in the Macro dialog box (Tools menu), the order is not alphabetic. The number can range from 1 to the number returned by CountMacros() in the given context.

If you specify 0 (zero) for Count, MacroName$() returns the name of the macro in the active (or most recently active) macro-editing window.

Context

Specifies the template from which the internal list of macros is generated:

0 (zero) Normal template

1 Active template

Note that if you specify 1 when Normal is the active template and Count is greater than 0, an error occurs.

All

If 1, all available macros, add-in commands, and built-in commands are listed in the following order: macros stored in the active template, macros stored in the Normal template, macros stored in loaded global templates, add-in commands, and built-in commands.

Global

If 1, only macros stored in loaded global templates and add-in commands are listed.


For an example that uses MacroName$(), see MacroDesc$().

See Also

CountMacros(), ListCommands