![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I am using outlook 2003. When creating a new mail with WordEditor enabled, an
exception is thrown. I tried to debug and the exception gets thrown (see code below) when I try to set the picture/mask property of a button. My buttons are created by my outlook add-in with my word add-in disabled. If I disable the outlook add-in and enable the word one, the buttons creation is successful. Thank you for your help... Here is how I create my menubar and button : CommandBar menuBar = context.GetCommandBars().ActiveMenuBar; int controlCount = menuBar.Controls.Count; // Add the menu two positions before the last one which is "Help" (before Help and Windows menus). CommandBarPopup rootMenu = (CommandBarPopup) menuBar.Controls.Add( MsoControlType.msoControlPopup, Missing.Value, Missing.Value, controlCount - 1, true); if (rootMenu == null) { return null; } rootMenu.Caption = "ProductNameMenu"; rootMenu.Tag = NAME_MENU_BAR; rootMenu.DescriptionText = "ProductName"; rootMenu.OLEUsage = MsoControlOLEUsage.msoControlOLEUsageClient; rootMenu.TooltipText = "ProductName"; rootMenu.Visible = true; rootMenu.Enabled = true; return AddMenuButtons(context, rootMenu); CommandBarButton myButton = (CommandBarButton) rootMenu.Controls.Add(MsoControlType.msoControlBut ton, Missing.Value, Missing.Value, Missing.Value, true); myButton .Caption = "Caption"; myButton .Style = MsoButtonStyle.msoButtonAutomatic; myButton .TooltipText = context.GetButtonSuperTip(); myButton .DescriptionText = context.GetButtonSuperTip(); myButton .OLEUsage = MsoControlOLEUsage.msoControlOLEUsageClient; myButton .Picture = AxHelper.GetIPictureDispFromImage(BitmapAddDocumen t); myButton .Mask = AxHelper.GetIPictureDispFromImage(BitmapAddDocumen tMask); myButton .Visible = true; myButton .Enabled = true; // This the class that helps to implement GetIPictureDispFromImage public class AxHelper : AxHost { private AxHelper() : base(null){} public static IPictureDisp GetIPictureDispFromImage(Image image) { return (IPictureDisp)GetIPictureDispFromPicture(image); } public new static IPicture GetIPictureFromPicture(Image image) { return GetIPictureFromPicture(image); } } |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Recover Mail? - Catastrophic HD failure | kimdnw | Outlook - Installation | 2 | December 5th 07 10:56 PM |
Catastrophic Failure | Mark | Add-ins for Outlook | 7 | September 19th 07 06:36 PM |
Error Message: Managed MAPI Service Catastrophic Failure | BearlyCat | Outlook - General Queries | 0 | November 27th 06 06:02 PM |
Outlook 2007 Beta Catastrophic Failure | Tibelian | Outlook - General Queries | 19 | August 4th 06 01:28 AM |
Catastrophic Failure while accessing Redemption.SafeMailItem.To and Recipients | jisha | Outlook and VBA | 1 | June 30th 06 05:48 PM |