Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Setting A Command Bar Button Picture - Catastrophic Failure Error

Geek News

Setting A Command Bar Button Picture - Catastrophic Failure Error
Whatever <NOSPAMHERE[ at ]bollocks.com> 7/14/2006 11:28:15 AM
Hi,

I've developed a COM addin for Outllook (using VB6) which places a new
command bar button into the Standard toolbar. The button is created
for each inspector window at the point it is opened. The button needs
to have both an icon and text but I'm having trouble setting the icon.

Sample code executed when the inspector loads:

---------------------------------------------------------------------------------------------------------------
Set moButton =
moInspector.CommandBars.Item("Standard").Controls.Add(msoControlButton,
, , , True)

moButton.Caption = BUTTON_CAPTION_EMAIL
moButton.ToolTipText = BUTTON_TOOLTIP_EMAIL
moButton.Style = msoButtonIconAndCaption
moButton.Picture = VB.LoadResPicture(101, 0)
----------------------------------------------------------------------------------------------------------------

The last line of code fails and Outlook raises the following error:

-2147418113 - Catastrophic failure

The button displays and functions OK but without the intended icon.

Interestingly the same error occurs if I try to read the Picture
property into an object variable also. It seems any attempt to access
this property (read or write) causes the error.

Any ideas greatly appreciated.

Thanks
Paul.








Re: Setting A Command Bar Button Picture - Catastrophic Failure Error
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 7/14/2006 1:42:12 PM
See if this KB article helps: http://support.microsoft.com/kb/286460/en-us

--
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


"Whatever" <NOSPAMHERE[ at ]bollocks.com> wrote in message
news:auveb21ulufbumchcfkv23l4solgoedu8f[ at ]4ax.com...
[Quoted Text]
> Hi,
>
> I've developed a COM addin for Outllook (using VB6) which places a new
> command bar button into the Standard toolbar. The button is created
> for each inspector window at the point it is opened. The button needs
> to have both an icon and text but I'm having trouble setting the icon.
>
> Sample code executed when the inspector loads:
>
> ---------------------------------------------------------------------------------------------------------------
> Set moButton =
> moInspector.CommandBars.Item("Standard").Controls.Add(msoControlButton,
> , , , True)
>
> moButton.Caption = BUTTON_CAPTION_EMAIL
> moButton.ToolTipText = BUTTON_TOOLTIP_EMAIL
> moButton.Style = msoButtonIconAndCaption
> moButton.Picture = VB.LoadResPicture(101, 0)
> ----------------------------------------------------------------------------------------------------------------
>
> The last line of code fails and Outlook raises the following error:
>
> -2147418113 - Catastrophic failure
>
> The button displays and functions OK but without the intended icon.
>
> Interestingly the same error occurs if I try to read the Picture
> property into an object variable also. It seems any attempt to access
> this property (read or write) causes the error.
>
> Any ideas greatly appreciated.
>
> Thanks
> Paul.
>
>
>
>
>
>
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net