Table of contents
TOC
Collapse the table of content
Expand the table of content

CommandBars.ExecuteMso Method (Office)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Executes the control identified by the idMso parameter.

Syntax

expression. ExecuteMso( idMso )

expression An expression that returns a CommandBars object.

Parameters

NameRequired/OptionalData TypeDescription
idMsoRequiredStringIdentifier 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.

Application.CommandBars.ExecuteMso("Copy")

See also

Concepts

CommandBars Object

Other resources

CommandBars Object Members

© 2018 Microsoft