_Application.Run method

Runs a Visual Basic macro.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Object Run(
	string MacroName,
	ref Object varg1,
	ref Object varg2,
	ref Object varg3,
	ref Object varg4,
	ref Object varg5,
	ref Object varg6,
	ref Object varg7,
	ref Object varg8,
	ref Object varg9,
	ref Object varg10,
	ref Object varg11,
	ref Object varg12,
	ref Object varg13,
	ref Object varg14,
	ref Object varg15,
	ref Object varg16,
	ref Object varg17,
	ref Object varg18,
	ref Object varg19,
	ref Object varg20,
	ref Object varg21,
	ref Object varg22,
	ref Object varg23,
	ref Object varg24,
	ref Object varg25,
	ref Object varg26,
	ref Object varg27,
	ref Object varg28,
	ref Object varg29,
	ref Object varg30
)

Parameters

MacroName
Type: System.String

Required String. The name of the macro. Can be any combination of template, module, and macro name.

If you specify the document name, your code can only run macros in documents related to the current context— not just any macro in any document.

varg1
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg2
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg3
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg4
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg5
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg6
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg7
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg8
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg9
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg10
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg11
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg12
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg13
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg14
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg15
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg16
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg17
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg18
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg19
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg20
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg21
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg22
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg23
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg24
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg25
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg26
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg27
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg28
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg29
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

varg30
Type: System.Object

Optional Object. Macro parameter values. You can pass up to 30 parameter values to the specified macro.

Return value

Type: System.Object

Although you can call a macro directly (without using the Run method), this method is useful when the macro name is stored in a variable.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft