RunMacro()

Summary

Runs a macro.

Syntax

return_value = RunMacro(string macro_name, argument1, argument2,..., argument8)

Argument Contents
macro_name The name of the macro resource or macro dialog box item to run
Argument1, etc. Arguments to the macro, up to eight

Returns

The return value of the macro, if any, or null otherwise.

Notes

  • If extra arguments are passed to a macro, they are ignored. If too few arguments are passed to a macro, the macro receives null for the missing arguments.

  • A macro item within a dialog box cannot be passed arguments, nor can it return a value. All variables used within the dialog box are available within a macro item.

Error Codes

Error Type Meaning
Error When the called macro encounters an error and does not trap it, RunMacro() signals that error
NotFound The macro does not exist or encountered a NotFound error

See Also

Function Summary
RunDbox() Runs a dialog box or opens a toolbox or toolbar
Return() Returns from a called macro or dialog box