Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 1.21 KB

Office.CommandBars.ExecuteMso.md

File metadata and controls

50 lines (30 loc) · 1.21 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
CommandBars.ExecuteMso method (Office)
vbaof11.chm2018
vbaof11.chm2018
Office.CommandBars.ExecuteMso
6f608475-7a79-48c7-abff-86d9ab07fe80
01/04/2019
medium

CommandBars.ExecuteMso method (Office)

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.

Application.CommandBars.ExecuteMso("Copy")

See also

[!includeSupport and feedback]