title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
CommandBars.GetImageMso method (Office) |
vbaof11.chm2025 |
|
|
36261e2b-9cbf-b0b6-5892-63bbb2f93959 |
06/21/2019 |
medium |
Returns an IPictureDisp object of the control image identified by the idMso parameter scaled to the dimensions specified by width and height.
Note
The use of CommandBars in some Microsoft Office applications has been superseded by the new ribbon component of the Microsoft Office Fluent user interface. For more information, see Overview of the Office Fluent ribbon.
expression.GetImageMso (idMso, Width, Height)
expression An expression that returns a CommandBars object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
idMso | Required | String | Identifier for the control. |
Width | Required | Integer | The width of the image. |
Height | Required | Integer | The height of the image. |
IPictureDisp
The Width and Height parameters must be between 16 and 128.
Note
If GetImageMso doesn't appear as expected, it may be due to the recent icon redesign. For more information, see Your ribbon icons have a new look.
The following sample returns a 32x32 version of the Paste icon as an IPictureDisp object.
Application.CommandBars.GetImageMso("Paste", 32, 32)
[!includeSupport and feedback]