Access Ribbon Customisation

ShawneB

New member
Local time
Today, 15:26
Joined
Nov 29, 2014
Messages
2
Hi All, new to the forum. Couldnt find a forum for Ribbons so thought I would ask my question here.

I am having difficulty getting custom images to load into the Ribbon. I cant work out exactly when the loadimage is triggered in the xml. When it is triggered, for instance when loading a form with ribbon attached the second time(First time it is inst triggered) the images load perfectly via the VBA callback. It also appears to trigger when changing tabs by clicking on them but not when programmatically changing tabs?

It is a nuisance issue as when the program opens you have a ribbon without images and only once you start navigating the ribbon do they appear.

Been struggling with this for ages so any suggestions would be GREATLY appreciated.

Regards

SHawne
 
Also, you can force the ribbon to recalculate it's display by calling its Invalidate method.

To do this though, you have to save a copy of the ribbon on load, so you add this to your xml . . .
Code:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" [B][COLOR="DarkRed"]onLoad="RibbonLoad"[/COLOR][/B]>
Then, in a standard module you have code like . . .
Code:
private m_ribbon as IRibbonUI

Public Sub RibbonLoad(irui as IRibbonUI)
[COLOR="Green"]    'handles RibbonLoad callback, save a reference to the ribbon object[/COLOR]
    set m_ribbon = irui
End Sub

Global Property Get MyRibbon as IRibbonUI
[COLOR="Green"]    'exposes the ribbon for global access within your app[/COLOR]
    set MyRibbon = m_ribbon
End Property
. . . and then in any code, anywhere, you can force the entire ribbon to redraw itself by doing . . .
Code:
[COLOR="Green"]'references the global object, calls its Invalidate method[/COLOR]
MyRibbon.Invalidate

Hope this helps,
 

Users who are viewing this thread

Back
Top Bottom