Share via


CommandBars.ExecuteMso Method

Office Developer Reference
Aa434602.vs_note(en-us,office.12).gif  Note
The Microsoft Office Assistant has been deprecated in the 2007 release of the Microsoft Office system.

Executes the control identified by the idMso parameter.

Syntax

expression.ExecuteMso(idMso)

expression   An expression that returns a CommandBars object.

Parameters

Name Required/Optional Data Type Description
idMso Required String Identifier for the control.

Remarks

This method is useful in cases where there is no object model for a particular command. Works on controls that are built-in buttons, toggleButtons and splitButtons. On failure it returns E_InvalidArg for an invalid IdMso, and E_Fail for controls that are not enabled or not visible.

Example

The following sample executes the Copy button.

Visual Basic for Applications
  Application.CommandBars.ExecuteMso(“Copy”)

See Also