A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Tags: , , , , , , ,

Setting A Command Bar Button Picture - Catastrophic Failure Error





 
 
Thread Tools Display Modes
  #1  
Old July 14th 06, 03:11 PM posted to microsoft.public.outlook.program_vba
pswfps
external usenet poster
 
Posts: 1
Default Setting A Command Bar Button Picture - Catastrophic Failure Error

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.


Ads
  #2  
Old July 14th 06, 03:45 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,778
Default Setting A Command Bar Button Picture - Catastrophic Failure Error

Don't multipost. See my answer in another group you posted in.

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


"pswfps" wrote in message
...
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.



 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to prohibit command bar buttons customization? Andrey Starodoubtsev Outlook and VBA 1 July 13th 06 04:02 PM
Catastrophic Failure while accessing Redemption.SafeMailItem.To and Recipients jisha Outlook and VBA 1 June 30th 06 06:48 PM
how to find out, that inspector window contain command bar or not Ram Add-ins for Outlook 1 May 30th 06 03:17 PM
Command bar button FaceID Icon donald Add-ins for Outlook 20 February 9th 06 07:42 PM
Command button not working on read page jbtempe Outlook - Using Forms 2 January 14th 06 12:25 AM


All times are GMT +1. The time now is 03:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Loan - Credit Cards - Property in Spain - Property for sale in Spain - Buy Shares