Skip to main content

CommandBars.GetImageMso method

Returns an IPictureDisp object of the control image identified by the idMso parameter scaled to the dimensions specified by width and height.


expression.GetImageMso (idMsoWidthHeight)

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.

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)

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>