Westman

Hi,

I've developed an addin for Word 2007. It's working properly right now. My problem is : How do I load more than one image for my addin Right now i'm using the solution (exactly the same) from this article.

http://msdn2.microsoft.com/en-us/library/aa338202.aspx (loading image part)

When I add more image(.png) to my addin, it did not display correctly. By that I mean all the button display the same image(My addin have 6 button with certain function). So, how to solve this problem Do I need to use other method Can someone show me the way to do it Any help would be appreciated.

Regards,

Westman




Re: Visual Studio Tools for Office Load multiple image in VSTO 2005 SE addin

Dennis Wallentin

Hi Westman,

I'm not a 'Word-man' but it looks like a more general question about loading images. See if the following article from me can help You out - Creating & Deploying Managed COM Add-ins with VSTO 2005 SE - Part II.

If not then I suggest that You provide the forum the code involved.






Re: Visual Studio Tools for Office Load multiple image in VSTO 2005 SE addin

Westman

Hi Dennis,

Thanks for the reply. Yeah, your article give me an idea to tackle the problem. Before that I've managed to find a solution by using if..else condition. See a partial codes from my addin below. For the picture converter class, I use exactly the same code like yours.

Public Function GetImage( _

ByVal imageName As String) As stdole.IPictureDisp

If imageName = "edited32_bm_all.png" Then

Return PictureConverter.ImageToPictureDisp(My.Resources.edited32_bm_all)

ElseIf imageName = "edited32_eng_all.png" Then

Return PictureConverter.ImageToPictureDisp(My.Resources.edited32_eng_all)

ElseIf imageName = "edited32_tesaurus.png" Then

Return PictureConverter.ImageToPictureDisp(My.Resources.edited32_tesaurus)

ElseIf imageName = "edited16_bm_text.png" Then

Return PictureConverter.ImageToPictureDisp(My.Resources.edited16_bm_text)

ElseIf imageName = "edited16_eng_text.png" Then

Return PictureConverter.ImageToPictureDisp(My.Resources.edited16_eng_text)

ElseIf imageName = "edited16_cpanel.png" Then

Return PictureConverter.ImageToPictureDisp(My.Resources.edited16_cpanel)

End If

Return PictureConverter.ImageToPictureDisp(My.Resources.edited16_cpanel)

End Function

My question: Is this a correct/good method to call the image Will it cause a problem to my addin BTW, should I change the last return line to other image FYI, til now my addin working correctly(still no problem or strange thing happens). In your article, you use a case scenario, so I think my addin will produce the same result if I use your code, right

Regards,

Westman






Re: Visual Studio Tools for Office Load multiple image in VSTO 2005 SE addin

Dennis Wallentin

Hi Westman,

Sorry for late reply as I have missed Your latest post. The Select Case gives a structure that simplify the work, especially for maintance.