Share via


ExecuteCommand Method

Home Page (Objects)OverviewFAQReference

Applies to: Application object

Executes a specified command or VBScript macro.

Syntax

object**.ExecuteCommand**command

Parameters

object

An expression that evaluates to an Application object. When you use the ExecuteCommand method of the Application object, you can omit object because the name of the Application object is implied when you access its properties and methods.

command

A String that represents the command or macro you want to execute.

Remarks

You can use the ExecuteCommand method to run commands or macros listed on the Keyboard tab of the Customize dialog box (Tools menu, Customize command).

You can also use commands or macros by running them from the command line or by pressing toolbar buttons or keystrokes associated with them.

Example

The following example executes the AddRevisionMarks macro in Program Files\Microsoft Visual Studio\Common\MSDEV98\Macros\Sample.dsm:

ExecuteCommand AddRevisionMarks