Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having trouble adding a ribbon control to my Outlook 2010 Addin

While learning on working with the ribbon UI in my outlook addin(VS2010), I deleted and added ribbon items several times. Since yesterday, when I am adding a ribbon item, some of the autogenerated code is not compiling.

partial class ThisRibbonCollection
{
    internal MyRibbon MyRibbon
    {
        get { return this.GetRibbon<MyRibbon>(); }
    }
}

The error thrown is

'MyAddin.ThisRibbonCollection' does not contain a definition for 'GetRibbon' and no extension method 'GetRibbon' accepting a first argument of type 'MyAddin.ThisRibbonCollection' could be found (are you missing a using directive or an assembly reference?)

So, to get rid of this, I commented out the code block and it compiled. Now, the issue I am facing is that I cannot access the ribbon via the Globals object as mentioned here.Access Ribbons at runtime . I tried "grepping" the entire solution for ribbon specific code and deleted them and tried adding a ribbon item but the issue persists.

I can access my addin from the controls on my ribbon but the reverse is not happening.

like image 496
Abhi Avatar asked Aug 02 '12 13:08

Abhi


1 Answers

That error may be is because you create the ribbon in a folder, creating a new namespace.

Easy solution: delete the namespace name.

like image 133
Tavo Avatar answered Oct 19 '22 00:10

Tavo