![]() |
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
|
|||
|
|||
![]()
Hello All,
I have an Add-in developed for Outlook 2003. Before this change I was adding an image to the ".Picture" property of the button after initially adding the button to a popup object. Everything worked fine, however, I decided the popup object wasn't needed when there was only one associated for a toolbar. The buttons where I removed the popup object throws following error when its been created: " Error HRESULT E_FAIL has been returned from a call to a COM component". the other buttons that have a popup, work fine. The image being added is the same everywhere. This is the class where I create and assign the image to a global variable: Public Class clsScaryFace Inherits System.Windows.Forms.AxHost Public Sub New() MyBase.New("59EE46BA-677D-4d20-BF10-8D8067CB8B32") End Sub Public Sub GetScaryFace() Dim scaryFaceImage As Bitmap = Nothing 'Dim scaryFaceMask As Bitmap = Nothing Try scaryFaceImage = My.Resources.Scaryface.scaryface 'scaryFaceMask = My.Resources.Scaryface.scary_mask If (Exists(scaryFaceImage)) Then g_imgScaryFace = Convert(scaryFaceImage) 'g_imgScaryFaceMask = Convert(scaryFaceMask) End If Catch ex As Exception MessageBox.Show(ex.Message) Finally scaryFaceImage = Nothing 'scaryFaceMask = Nothing End Try End Sub Private Function Convert(ByVal Image As System.Drawing.Image) As stdole.IPictureDisp Convert = CType(GetIPictureDispFromPicture(Image), stdole.IPictureDisp) End Function End Class This is where I add the button: m_butOldEmailSyncToCS = CType(m_OldEmailCSToolBar.Controls.Add(MsoControlT ype.msoControlButton, , , , Temporary:=True), Office.CommandBarButton) This is where I set the properties after which it blows up when attempting to assign the g_imgScaryFace With m_butOldEmailSyncToCS .Caption = "Save to CS" .Visible = True .Enabled = True .Style = Microsoft.Office.Core.MsoButtonStyle.msoButtonIcon AndCaption .Picture = g_imgScaryFace End With Anyone has any ideas what's going wrong? Regards, |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom Image added to CommandBar Buttons | Andrew | Add-ins for Outlook | 2 | November 26th 08 03:26 PM |
Redemption Pickfolder at offline throws an error | Bert_Bert[_2_] | Add-ins for Outlook | 2 | October 29th 08 10:21 PM |
Outlook 2007 throws constant Error - please HELP | Snig | Outlook - Installation | 0 | May 14th 07 03:04 PM |
Image added in Signature shows as attachment | Sivakumar | Outlook - Using Forms | 0 | October 4th 06 07:40 AM |
Help Add button Popup | Robert | Outlook and VBA | 7 | February 17th 06 04:16 PM |