Where is Factory from?

I am trying to add items to shared buttons and galleries. The problem is related to Factory. In the following code, the OfficeRibbon Factory code is unknown. It is also unknown in the addin code file. I’m missing a link somewhere. I also tried Globals.Factory is still unknown.

RibbonButton rc = this.Factory.CreateRibbonButton(); 

I have the following statements.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
using Microsoft.Office.Interop.Excel;
using Microsoft.Office.Tools.Ribbon;
//using Microsoft.Office.Tools.Excel.Extensions;

This code also does not work in ThisAddin.cs, which was renamed to ReqCommon.cs in my project.

My desired end goal is to dynamically add elements to these two controls. The examples I found here and elsewhere seem to be based on this elusive Factory.

The project refers to Microsoft.Office.Tools.Common.v9.0.dll

+5
source share
1 answer

Ribbon Designer - Factory (Globals.Factory.GetRibbonFactory()) - Factory CreateRibbonExtensibilityObject() ThisAddin.cs ( ReqCommon.cs)

protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
{  
    Ribbon1 tempRibbon = new Ribbon1();
    tempRibbon.tab1.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office;
    tempRibbon.tab1.ControlId.OfficeId = "TabHome";
    return Globals.Factory.GetRibbonFactory().CreateRibbonManager(new Microsoft.Office.Tools.Ribbon.IRibbonExtension[] { tempRibbon });   
}

Ribbon Designer Ribbon.RibbonBase, RibbonBase.Factory, this.Factory .

+4

All Articles