I’m working on template in Office 2007 and using Microsoft Visual Basic Editor. I started out by copying and modifying another template that was probably created with Office 2003 or before.
I am trying to work with the Fluent Ribbon to add new tab to template and was successful doing that.
Where I run into problem is when I try to put my own image on a button. I use the customUI.xml file to add the tab and in the file I have the child node:
<button id="Button2" label="My Normal Button" image=”C:\myImage.jpg”
size="normal" onAction="Common.MyMacro" />
I found the below code to get the image:
Friend Class PictureConverter
Inherits AxHost
Private Sub New()
MyBase.New(String.Empty)
End Sub
Public Shared Function ImageToPictureDisp( _
ByVal image As Image) As stdole.IPictureDisp
Return CType(GetIPictureDispFromPicture(image), _
stdole.IPictureDisp)
End Function
Public Shared Function IconToPictureDisp( _
ByVal icon As Icon) As stdole.IPictureDisp
Return ImageToPictureDisp(icon.ToBitmap())
End Function
Public Shared Function PictureDispToImage( _
ByVal picture As stdole.IPictureDisp) As Image
Return GetPictureFromIPicture(picture)
End Function
End Class
Public Function GetImage( _
ByVal imageName As String) As stdole.IPictureDisp
Return PictureConverter.IconToPictureDisp(My.Resources.MyIcon)
End Function
My problem is that I can’t get my project to recognize stdole.dll and I don’t know where to add it to the project. I am on a computer at work so I can’t install anything but it does have Visual Studio 5 installed and using Windows Explorer I can go to the
C:\WINNT\assembly dir and see the stdole.dll (version 7.0.3300)file in the Global Assembly Cache. So I read that if the project was created with Visual Studio the project should automatically get the reference to the stdole.dll. How can I get my project that
was created with Visual Basic editor to reference the stdole.dll?