customUI - loadImage

 

LoadImageThe callback loadImage determines what function should be used for loading pictures for all controls.

In case you want to change pictures dynamically you have to use the callback getImage, as loadImage will not be run during InvalidateControl "ControlID" and Invalidate.


This function submits the contents of Control Parameter "image" and expects the IPictureDisp Object in return.


Sample Ribbon XML file: 

 

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" loadImage="CallbackLoadImage"> 
    <ribbon startFromScratch="false"> 
        <tabs> 
            <tab> 
                <group>
                    <!-- Further XML Code -->
                    <button id="MyButton" image="myImage.JPG"/> 
                </group> 
            </tab>
        </tabs> 
    </ribbon>
</customUI>  

Function to be copied to a standard module:

Sub CallbackLoadImage(imageID As String, _
                     ByRef image)
    ' Callback loadImage 
    Set image = LoadPicture(getAppPath & imageID)
End Sub

 

 

 

 

Back