Represents the entire custom ribbon.
This is the root tag of all Ribbon customisations.

<customUI xlmns=""> 

Events (design-time)

The Load event can be accessed if you use the Visual Studio Ribbon Designer.

' C#
public void Ribbon_Load(object sender,
                        RibbonControlEventArgs e)
this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler(this.Ribbon_Load);

Attributes (properties)

xmlns - stringmust be set to:
Contextonly used by Outlook. This has a Context property which can be cast to an Inspector object in Outlook. This allows you to get the inspector associated with the ribbon. Context is null for other applications.
GlobalThe Global property can be set to false to force every Inspector window created is associated with a unique ribbon instance
Tabsreturns all the tabs associated with the ribbon


commandsThis can be used to repurpose built-in controls

Callbacks (run-time)

onLoadpasses a ribbon parameter to the callback procedure as the Ribbon loads. This enables the associated code to store a reference to the Ribbon for later use and allows you to dynamically update the Ribbon.
loadImageenables you to create a single procedure that loads all the images required for the Ribbon.

' C#
public void Ribbon_OnLoad(Office.IRibbonUI ribbonUI)
   this.ribbon = ribbonUI

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext