PC Review


Reply
Thread Tools Rate Thread

Adding a picture to a CommandBarButton

 
 
=?Utf-8?B?Um9iTA==?=
Guest
Posts: n/a
 
      10th Aug 2005
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
--
Software Support Engineer
i2 Ltd.
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      10th Aug 2005
It must be a BMP of 16x16 with 256 colors to comply with the Office button
picture specs.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"RobL" <(E-Mail Removed)> wrote in message
news:30E47631-6780-4FDB-84A6-(E-Mail Removed)...
> 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
> --
> Software Support Engineer
> i2 Ltd.


 
Reply With Quote
 
=?Utf-8?B?Um9iTA==?=
Guest
Posts: n/a
 
      10th Aug 2005
Thank you Ken,

you're a gent and a scholar!

Rob
--
Software Support Engineer
i2 Ltd.


"Ken Slovak - [MVP - Outlook]" wrote:

> It must be a BMP of 16x16 with 256 colors to comply with the Office button
> picture specs.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "RobL" <(E-Mail Removed)> wrote in message
> news:30E47631-6780-4FDB-84A6-(E-Mail Removed)...
> > 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
> > --
> > Software Support Engineer
> > i2 Ltd.

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CommandBarButton Picture, transparency =?Utf-8?B?TWlrZQ==?= Microsoft Outlook Program Addins 1 26th Sep 2007 02:19 PM
When adding picture in email message, the quality of the picture is bad when the recipient receives it Jawiko Microsoft Outlook Discussion 0 15th Jan 2007 04:58 PM
add a picture to a CommandBarButton =?Utf-8?B?RGF2aWRIJlA=?= Microsoft Outlook Form Programming 0 30th Aug 2006 03:35 PM
Adding a picture =?Utf-8?B?aW40c2l0?= Microsoft Access 1 14th Mar 2006 06:43 PM
Set CommandBarButton.Picture property (c++) Eric Microsoft Outlook Program Addins 12 24th Jan 2004 12:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:14 AM.