Displaying contextual tab for Word Addin

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

Displaying contextual tab for Word Addin
 
Sujay Ghosh




Posts: 27
Joined: 2010-01-20
Hello

We have a Word addin , inserting the image below

User added an image

https://pasteboard.co/JA3b3gl.png

We would like to display a contextual tab "Action" having three buttons , when the user click on Batch Letters.

I have seen the Context property, but not sure how to use it .

Please help .

Thanks
Sujay
Posted 12 Nov, 2020 13:04:35 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Sujay,

Create a new ADXRibbonTab, set its IdMso property to the IdMso of the built-in Ribbon tab to be customized, set the ADXRibbonTab.Context property to point to the built-in contextual tab, and, finally, set ADXRibbonTab.Ribbons to OutlookMailCompose.


Andrei Smolin
Add-in Express Team Leader

UPDATE: 20-Nov-2020. The text above contains mistakes, please see the messages below.
Posted 13 Nov, 2020 00:54:57 Top
Sujay Ghosh




Posts: 27
Joined: 2010-01-20
Hello Andrei ,

Okay I shall try that .

None of the tabs are built it , all of the tabs are developed by us .

Is this correct for Word Addin - set ADXRibbonTab.Ribbons to OutlookMailCompose.


Thanks
Sujay
Posted 13 Nov, 2020 01:13:12 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Sujay,

You customize the UI of the Office application. That means creating Ribbon controls and placing them among built-in Ribbon tabs and controls.

Sujay Ghosh writes:
Is this correct for Word Addin - set ADXRibbonTab.Ribbons to OutlookMailCompose.


Sorry, that should be WordDocument.


Andrei Smolin
Add-in Express Team Leader
Posted 13 Nov, 2020 01:17:13 Top
Sujay Ghosh




Posts: 27
Joined: 2010-01-20
Hello Andrei ,

I tried your approach , with the attached project, but could not display it .

In the attached project , there are two tabs, the adxRibbonMain is the main tab, and adxRibbonContextTab is the contextual tab. I

We would like to display adxRibbonContextTab when I click on the "Second" button of adxRibbonMain . I did try with idMso , but cant understand what should be idMso for adxRibbonContextTab . if I provide isMso to "MyRibbon", not even the main ribbon is being displayed.

As for the Context ,it should be MyRibbon , not the built in context . I cant understand how to do it.

I have uploaded the project at https://wsi.li/dl/Txf4oYC7FHD9hhfc3/

It shall be very helpful if you can modify the project and send it to me.

Thanks
Sujay
Posted 15 Nov, 2020 14:26:04 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Sujay,

Sujay Ghosh writes:
We would like to display adxRibbonContextTab when I click on the "Second" button of adxRibbonMain .


The Office Ribbon only supports built-in contextual tabs.


Andrei Smolin
Add-in Express Team Leader
Posted 16 Nov, 2020 02:58:35 Top
Sujay Ghosh




Posts: 27
Joined: 2010-01-20
Does that mean we can not display the contextual tab.

If your answer is Yes, it shall be very useful if Addin Express implements the functionality .

The following link has several other links for contextual tab .

https://social.msdn.microsoft.com/Forums/vstudio/en-US/8f0f4d72-363c-477b-9cab-6c96f1599090/creating-my-own-ribbon-contextual-tab-for-excel?forum=vsto

Thanks
Sujay
Posted 19 Nov, 2020 23:36:54 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Sujay,

That was my fault. Of course Office supports custom contextual tabs. A custom contextual tab can only be shown in a context that Office supports.

In one of my previous posts I described the procedure. I've rechecked it and found a mistake: it isn't required to set the IdMSO property so that the procedure is:

Create a new ADXRibbonTab, set the ADXRibbonTab.Context property to point to the built-in contextual tab, and, finally, set ADXRibbonTab.Ribbons.

In my case, the InitializeComponent method (it is called from the constructor of the add-in module) contains the following lines:

// 
// adxRibbonTab1
// 
this.adxRibbonTab1.Caption = "MyAddin80";
this.adxRibbonTab1.Context = "Word.TabSetTableTools";
this.adxRibbonTab1.Controls.Add(this.adxRibbonGroup1);
this.adxRibbonTab1.Id = "adxMainRibbon";
this.adxRibbonTab1.Ribbons = AddinExpress.MSO.ADXRibbons.msrWordDocument;


Hope this helps.


Andrei Smolin
Add-in Express Team Leader
Posted 20 Nov, 2020 02:42:14 Top