Programming with Reflection

image\rwnprg32.gif RunExternalMacro method


Syntax object.RunExternalMacro FileName, MacroName, MacroData



Runs a macro that is not in the current project. This method is useful for running a macro that you only need to use once. By using this method, you can run the macro without adding a permanent reference to the file containing that macro.

The following statement runs a macro called InitialSetup in the specified settings file:

Session.RunExternalMacro "C:\Mypath\Myfile.rsf", "InitialSetup", ""

If the referenced macro is not located in the default NewMacros module, you must use a fully qualified macro name. For example, the following statement runs a macro that was created in the ThisSession module:

Session.RunExternalMacro "C:\Mypath\Myfile.rsf", "Myfile.ThisSession.MyMacro", ""


FileName Argument type: String
The path and name of the file that contains the macro you want to run. An error is returned if you specify an invalid or non-existent file.

MacroName Argument type: String
The macro you want to run. An error is returned if the macro does not exist.

MacroData Argument type: String
Sets the value of the MacroData property.


image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command