Use a Built-In Ribbon Button in a Custom Ribbon

Add-in Express™ Support Service
That's what is more important than anything else

Use a Built-In Ribbon Button in a Custom Ribbon
 
tyrant




Posts: 17
Joined: 2007-05-10
Is it possible to use a Built-In Ribbon button in a custom Ribbon?

For example, say I want to include Cut button in my custom tab that will be used within Word.

Can I take the idMSO value for the Cut button (which is "cut") and specify it as the value for a button on my custom ribbon?

My testing says I can't as doing so causes the button to disappear completely.

I'm using adxnet-v501-b2022-vs-std

Thanks
Posted 17 Dec, 2009 23:59:30 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hi Ty,

Try the following settings for the button:

            // 
            // adxRibbonButton2
            // 
            this.adxRibbonButton2.Caption = "Cut";
            this.adxRibbonButton2.Id = "adxRibbonButton_ea6f36570f4c4d5c9654824eebfbcb07";
            this.adxRibbonButton2.IdMso = "Cut";
            this.adxRibbonButton2.ImageMso = "Cut";
            this.adxRibbonButton2.ImageTransparentColor = System.Drawing.Color.Transparent;
            this.adxRibbonButton2.Ribbons = AddinExpress.MSO.ADXRibbons.msrWordDocument;



Andrei Smolin
Add-in Express Team Leader
Posted 18 Dec, 2009 03:59:49 Top
tyrant




Posts: 17
Joined: 2007-05-10
Thanks Andrei,

I gave it a go and the button now appears. Not sure why as I was doing basically the same thing just with a different default button.

Anyways, the button appears and that's good.

The bad is that the button appears disabled even though its Enabled property is set to True.

Any ideas?

Thanks!
Posted 20 Dec, 2009 23:54:54 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hi Ty,

When I select some text in the document the button becomes enabled for me. It looks like Word controls that button.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Dec, 2009 03:51:56 Top
tyrant




Posts: 17
Joined: 2007-05-10
yep. It works for me too. Slightly embarrassed here. :oops:
Posted 21 Dec, 2009 10:12:21 Top
tyrant




Posts: 17
Joined: 2007-05-10
Andrei,

Let's try one more button...XmlStructure. This button is available in the Word Developer tab. It does not appear when I do everything you specify in your original response (substituting "cut" for "XmlStructure").

Thanks
Posted 21 Dec, 2009 10:18:01 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hi Ty,

            // 
            // adxRibbonButton1
            // 
            this.adxRibbonButton1.Caption = "adxRibbonButton1";
            this.adxRibbonButton1.Id = "adxRibbonButton_a84eff854e3d49fba27cbdda926948a6";
            this.adxRibbonButton1.IdMso = "XmlStructure";
            this.adxRibbonButton1.ImageMso = "XmlStructure";
            this.adxRibbonButton1.ImageTransparentColor = System.Drawing.Color.Transparent;
            this.adxRibbonButton1.Ribbons = AddinExpress.MSO.ADXRibbons.msrWordDocument;
            this.adxRibbonButton1.Size = AddinExpress.MSO.ADXRibbonXControlSize.Large;
            this.adxRibbonButton1.ToggleButton = true;


The ToggleButton property is set because in WordRibbonContols.xls (it's included in http://www.microsoft.com/downloads/details.aspx?FamilyID=4329d9e9-4d11-46a5-898d-23e4f331e9ae&DisplayLang=en) the ControlType of the XmlStructure control is toggleButton.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Dec, 2009 11:00:55 Top
tyrant




Posts: 17
Joined: 2007-05-10
Thanks Andrei. That did the trick.
Posted 21 Dec, 2009 13:44:14 Top