P
Peter Karlström
Hi
Does anyone have a clue on how to load a custom image to a Ribbon control
during runtime from a VB6 COM Addin?
I have the images in a resource file in the project and have tried this:
(XML parts)
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="Ribbon_OnLoad" loadImage="LoadImage">
<toggleButton id="btnLang1" label="Swedish" image="btnSve"
onAction="OnActionTglButton" getPressed="GetPressedTglButton"
getEnabled="GetStatus" />
<toggleButton id="btnLang2" label="English" image="btnEng"
onAction="OnActionTglButton" getPressed="GetPressedTglButton"
getEnabled="GetStatus" />
(VB6 Addin code)
Function LoadImage(imageId As String) As IPictureDisp
Select Case imageId
Case "btnSve"
Set LoadImage = LoadResPicture(1001, vbResBitmap)
Case "btnEng"
Set LoadImage = LoadResPicture(1002, vbResBitmap)
End Select
End Function
The images in the resource file is of bitmap type.
The Word userinterface responds with an exception error message, and the
images is not loaded.
Anybody?
Thanks in advance
Does anyone have a clue on how to load a custom image to a Ribbon control
during runtime from a VB6 COM Addin?
I have the images in a resource file in the project and have tried this:
(XML parts)
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="Ribbon_OnLoad" loadImage="LoadImage">
<toggleButton id="btnLang1" label="Swedish" image="btnSve"
onAction="OnActionTglButton" getPressed="GetPressedTglButton"
getEnabled="GetStatus" />
<toggleButton id="btnLang2" label="English" image="btnEng"
onAction="OnActionTglButton" getPressed="GetPressedTglButton"
getEnabled="GetStatus" />
(VB6 Addin code)
Function LoadImage(imageId As String) As IPictureDisp
Select Case imageId
Case "btnSve"
Set LoadImage = LoadResPicture(1001, vbResBitmap)
Case "btnEng"
Set LoadImage = LoadResPicture(1002, vbResBitmap)
End Select
End Function
The images in the resource file is of bitmap type.
The Word userinterface responds with an exception error message, and the
images is not loaded.
Anybody?
Thanks in advance