In the MyRibbon.cs or MyRibbon.vb file, locate the code comments that start with TODO:, and uncomment the definition of the partial ThisAddIn class. This code enables the Microsoft Office application to discover and load your custom Ribbon UI. For more information, see Ribbon Extensibility Overview.
After you uncomment the code, it should resemble the following example.
' TODO:
' This is an override of the RequestService method in ThisAddin class.
' To hook up your custom ribbon uncomment this code.
Partial Public Class ThisAddIn
Private ribbon As MyRibbon
Protected Overrides Function RequestService(ByVal serviceGuid As System.Guid) As Object
If (serviceGuid = GetType(Office.IRibbonExtensibility).GUID) Then
If ribbon Is Nothing Then
ribbon = New MyRibbon()
End If
Return ribbon
End If
Return MyBase.RequestService(serviceGuid)
End Function
End Class
// TODO:
// This is an override of the RequestService method in ThisAddin class.
// To hook up your custom ribbon uncomment this code.
public partial class ThisAddIn
{
MyRibbon ribbon;
protected override object RequestService(Guid serviceGuid)
{
if (serviceGuid == typeof(Office.IRibbonExtensibility).GUID)
{
if (ribbon == null)
ribbon = new MyRibbon();
return ribbon;
}
return base.RequestService(serviceGuid);
}
}