![]() |
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 in Visual Studio 2008, written in VB.Net for Outlook 2003 that I'm trying to add a custom image to commandbar buttons that I created. The image displays correctly in every inspector window except when I select Microsoft Word as the email editor. When that is selected and I open a New mail, it throws the following error: "Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))" This is happening on my development machine! The code to add the custom image was also ported to another project for Outlook 2007 which works flawlessly. Here is the class where I get the image and store it in a global variable which I'm adding to the ".Picture" property of button when its created. 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 If (Exists(scaryFaceImage)) Then g_imgScaryFace = Convert(scaryFaceImage) End If Catch ex As Exception MessageBox.Show(ex.Message) Finally scaryFaceImage = 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 I have no idea why this breaks when WordMail is selected as the editor; any assistance would be greatly appreciated. Regards |
Ads |
#2
|
|||
|
|||
![]()
..Picture and .Mask take IPictureDisp objects, which cannot be passed across
process boundaries. WordMail 2003 is a subclassed word.exe and so is running in another process space. You must use .PasteFace for WordMail 2003 button images. Put the image on the clipboard and .PasteFace will take it from there. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Andrew" wrote in message news ![]() Hello All, I have an add-in developed in Visual Studio 2008, written in VB.Net for Outlook 2003 that I'm trying to add a custom image to commandbar buttons that I created. The image displays correctly in every inspector window except when I select Microsoft Word as the email editor. When that is selected and I open a New mail, it throws the following error: "Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))" This is happening on my development machine! The code to add the custom image was also ported to another project for Outlook 2007 which works flawlessly. Here is the class where I get the image and store it in a global variable which I'm adding to the ".Picture" property of button when its created. 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 If (Exists(scaryFaceImage)) Then g_imgScaryFace = Convert(scaryFaceImage) End If Catch ex As Exception MessageBox.Show(ex.Message) Finally scaryFaceImage = 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 I have no idea why this breaks when WordMail is selected as the editor; any assistance would be greatly appreciated. Regards |
#3
|
|||
|
|||
![]()
Thanks a lot Ken!
Regards, Andrew "Andrew" wrote: Hello All, I have an add-in developed in Visual Studio 2008, written in VB.Net for Outlook 2003 that I'm trying to add a custom image to commandbar buttons that I created. The image displays correctly in every inspector window except when I select Microsoft Word as the email editor. When that is selected and I open a New mail, it throws the following error: "Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))" This is happening on my development machine! The code to add the custom image was also ported to another project for Outlook 2007 which works flawlessly. Here is the class where I get the image and store it in a global variable which I'm adding to the ".Picture" property of button when its created. 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 If (Exists(scaryFaceImage)) Then g_imgScaryFace = Convert(scaryFaceImage) End If Catch ex As Exception MessageBox.Show(ex.Message) Finally scaryFaceImage = 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 I have no idea why this breaks when WordMail is selected as the editor; any assistance would be greatly appreciated. Regards |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Add custom icon to commandbar button | Dhananjay | Outlook and VBA | 1 | October 24th 07 09:58 PM |
Adding image to Outlook commandbar button | saturn | Add-ins for Outlook | 3 | August 3rd 07 02:13 PM |
Enable/Disable Commandbar buttons | Bodo | Add-ins for Outlook | 3 | July 12th 07 02:14 PM |
Custom Commandbar doesn't appear when opening or creating a new email | Karsten_Markmann | Outlook and VBA | 2 | July 19th 06 06:26 AM |
Custom CommandBar in Wordmail Editor. | Sanjay | Add-ins for Outlook | 0 | May 31st 06 10:11 PM |