RunMacro Method

Official Content
This documentation is valid for:
Runs the indicated Macro contained in the document, with the specified parameters.

Syntax

&DataType.RunMacro(MacroName [ , Par1 ... [ , Par30 ] ] )

Type Returned:
Numeric

Where:
Par1 ... Par30
   Are parameters used by the macro. 
 
Notes:
  • The parameters are only input parameters. If the called macro returns values, these will remain stored in the MacroReturnText, MacroReturnNumber and MacroReturnDate properties, according to their types. 
  • There is a maximum of 30 parameters. This is a Word limitation.
  • If this method is used with Office 97, it is not possible to use parameters. This is an Office 97 limitation. Thus, in this case, invoking MacroReturnText, MacroReturnNumber and MacroReturnDate properties is not possible either.
  • This method returns an error code, so it is possible to call it as a function (&Err = &DataType.RunMacro(…..)).

Scope

Extended Data Types: ExcelDocument, WordDocument
Languages: Visual Basic, Visual FoxPro

See Also

MacroReturnDate Property
MacroReturnNumber Property
MacroReturnText Property
ExcelDocument Data Type
WordDocument Data Type