Adding a picture to a CommandBarButton

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

can anyone tell me the constraints on an IPictureDisp object, which will
allow it to be used in a CommandBarButton.Picture instruction?

I have a form with an ImageList on it and am trying to run the following
code (not in debug mode I hasten to add. I build the project first):

objButton.Style = msoButtonmsoButtonIconAndCaption
Set picIcon = frmForm.imgImageList.ListImages.Item(1).Picture
objButton.Picture = picIcon

and get "Invalid procedure call or argument" when the last line runs.

My current best guess is that the image I'm trying to use is either the
wrong size or the wrong colour depth.

Am I correct?

Thanks,

Rob Levy
 
It must be a BMP of 16x16 with 256 colors to comply with the Office button
picture specs.
 
Thank you Ken,

you're a gent and a scholar!

Rob
--
Software Support Engineer
i2 Ltd.


Ken Slovak - said:
It must be a BMP of 16x16 with 256 colors to comply with the Office button
picture specs.
 
Back
Top