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

CommandBars.GetImageMso Method (Office)

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

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, search Help for the keyword "ribbon."


expression. GetImageMso( idMso, Width, Height )

expression An expression that returns a CommandBars object.


NameRequired/OptionalData TypeDescription
idMsoRequiredStringIdentifier for the control.
WidthRequiredIntegerThe width of the image.
HeightRequiredIntegerThe height of the image.

Return Value



The Width and Height parameters must be between 16 and 128.


The following sample returns a 32x32 version of the Paste icon as an IPictureDisp object.

Application.CommandBars.GetImageMso("Paste", 32, 32)

See also


CommandBars Object

Other resources

CommandBars Object Members

© 2018 Microsoft