customUI

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


<customUI xlmns="schemas.microsoft.com/office/2009/07/customui"> 
      onLoad="Ribbon_OnLoad"
      loadImage="AddIn-LoadImage">
   <ribbon>
   <commands>

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: http://schemas.microsoft.com/office/2006/01/customui
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

Children

ribbon 
commandsThis can be used to repurpose built-in controls

Callbacks (run-time)

Close 
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.

' VBA
Public Sub Ribbon_OnLoad(ribbon As IRibbonUI)
   Set g_oRibbon = ribbon
End Sub

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

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