Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ribbon Custom Button Image Not Loading

Status
Not open for further replies.

LCJ18786

Programmer
Nov 23, 2011
9
0
0
GB
I am working on a ribbon addin for Outlook 2010 using XML and VB callbacks (I have not used the ribbon designer) in Visual Studio 2010.

What I want to do is add a custom image to a button loaded by another addin. Using the code below the image appears on a standard button but not on the button from the addin. The only difference seems to be using either the id or idQ properties, "idQ" does not work.

Any help would be much appreciated.




XML

<customUI xmlns=" xmlns:x1="MCSearch.Connect" xmlns:x2="VisionMerge.Connect" onLoad="Ribbon_OnLoad" loadImage="GetImage">
<ribbon>
<tabs>

<tab idMso="TabReadMessage">

<group idMso="GroupMailDelete" visible="false" />
<group idMso="GroupRespond" visible="false" />
<group idMso="GroupMoveActions" visible="false" />
<group idQ="x2:IIRIS.Law" visible="false" />

<group id="IIRIS.Law" label="IRIS Law" visible="true" insertBeforeMso="GroupRespond" autoScale="true">

<button idQ="x2:SendSave.Email" image="SaveAndSend.jpg"/> 'this does NOT work
<button id="Test" label ="Test" image="SaveAndSend.jpg"/> 'this does work

</group>

</tab>
</tabs>
</ribbon>
</customUI>




'VB Callbacks

Public Function GetImage(ByVal imageName As String) As stdole.IPictureDisp
Return PictureConverter.ImageToPictureDisp(My.Resources.SaveAndSend)
End Function


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
End Class
 
Just to let you know that I got the answer (see below)


"Customization of ribbon from one add-in cannot be changed from another add-in. So what you want to achieve is not possible using VSTO/OOM.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top