Adding new RibbonGroup to Search

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

Adding new RibbonGroup to Search
 
Subscribe
Mike VE




Posts: 164
Joined: 2007-09-09
I one of my add-ins I want to add a button to the TabSearchQuery but am not succeeding in getting it working. I have defined a new adxRibbonTab containing an adxRibbonGroup which contains an adxRibbonButton. The relevant properties are as follows:
AdxRibbonTab
Context = Outlook.TabSetSearch
IdMso = TabSearchQuery
InsertBeforeIdMso = GroupClearSearch
Ribbons = OutlookExplorer

AdxRibbonGroup
InsertBeforeIdMso = GroupClearSearch
Ribbons = OutlookExplorer

When I search for something and the Outlook's TabSetSearch comes into view my group & button are nowhere to be seen. What have I missed?
Posted 10 Sep, 2021 11:15:57 Top
Andrei Smolin


Add-in Express team


Posts: 17871
Joined: 2006-05-11
Hello Mike,

The tab's IdMso should be empty, I believe. If this helps, I would strongly recommend that you select the 'Show add-in user interface errors' check box; see the Developer section on the File -> Options - >Advanced page. With that checkbox selected your current settings should produce a message (sort of) "You can't customize a Ribbon control container".

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 10 Sep, 2021 12:58:54 Top
Mike VE




Posts: 164
Joined: 2007-09-09
Thanks Andrei. I have removed the IdMso from the AdxRibbonTab so that the relevant settings are now
AdxRibbonTab
Context: Outlook.TabSetSearch
InsertBeforeIdMso: GroupClearSearch
Ribbons: OutlookExplorer

AdxRibbonGroup
InsertBeforeIdMso: GroupClearSearch
Ribbons: OutlookExplorer

I have ticked the Show add-in user interface errors but none are reported.

The effect of the above settings is that my custom tab appears in the ribbon when search is activated. What I was after was my custom group appearing in the SearchQuery tab before the ClearSearchGroup.
Posted 14 Sep, 2021 03:27:20 Top
Andrei Smolin


Add-in Express team


Posts: 17871
Joined: 2006-05-11
Hello Mike,

You are right: my suggestion was about creating a new tab rather than customizing the built-in one.

I've created a simple XML the main part of which is this:

        <contextualTabs>
          <tabSet idMso="TabSetSearch">
              <tab idMso="TabSearchQuery">
                  <group id="group1" label="group1">
                      <button id="button1" label="button1" showImage="false" />
                  </group>
              </tab>
          </tabSet>
        </contextualTabs>


Alas, when the add-in loads, this XML produces a message informing that TabSearchQuery is a wrong ID. To see that message the 'Show add-in user interface errors' check box must be selected.

The same XML works if I replace TabSetSearch-->TabSetAttachments and TabSearchQuery-->TabAttachments.

I assume this means Outlook doesn't accept "TabSearchQuery" because of an issue in its code. I don't see a way to achieve your goal until they fix the issue.

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 14 Sep, 2021 09:51:15 Top
Mike VE




Posts: 164
Joined: 2007-09-09
Thanks for that, Andrei. The strange thing is I had it working about 9 to 6 months ago but then had to turn my attention to other projects. When I came back it would not work and I presumed it was something I had done. Could Microsoft have changed the IdMso?
Posted 15 Sep, 2021 11:22:25 Top
Andrei Smolin


Add-in Express team


Posts: 17871
Joined: 2006-05-11
Hello Mike,

I've tested showing a custom tab using InsertBeforeIdMso="TabSearchQuery". I get no error message but the custom tab is added after the built-in tab.

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 16 Sep, 2021 08:38:53 Top
Mike VE




Posts: 164
Joined: 2007-09-09
Hi Andrei

I have managed to get the required effect but not through code. I used Outlook's Customize Ribbon Dialog box and set the button that already appears on the main TabMail to be added to the Search Tools Tab.

The next task would be to look at the Ribbon XML that this modification produces so I can check the idMso involved but I can not find it. Where would it be?
Posted 17 Sep, 2021 15:51:56 Top
Andrei Smolin


Add-in Express team


Posts: 17871
Joined: 2006-05-11
Hello Mike,

Check the XML in C:\Users\{user account}\AppData\Local\Microsoft\Office\olkexplorer.officeUI; prettify it at https://www.samltool.com/prettyprint.php.

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 18 Sep, 2021 05:02:10 Top
Mike VE




Posts: 164
Joined: 2007-09-09
Thanks for that Andrei

The relevant XML was
<mso:tabSet idMso="TabSetSearch">
<mso:tab idQ="mso:TabSearchQueryRefineSearchFirst">
<mso:group idQ="x2:adxRibbonGroup_60117b3fccf14df498bb8510e706e90b" insertBeforeQ="mso:GroupClearSearch"/>
</mso:tab>
</mso:tabSet>

So I tried TabSearchQueryRefineSearchFirst is the ADX designer as the tab IdMso and hey presto the thing worked as intended.
Posted 20 Sep, 2021 04:59:23 Top
Andrei Smolin


Add-in Express team


Posts: 17871
Joined: 2006-05-11
Hello Mike,

That's great! Absolutely!

Needless to say that Google doesn't know that you need to customize "TabSearchQueryRefineSearchFirst" when you need to customize "TabSearchQuery". I've noted the "First" in "TabSearchQueryRefineSearchFirst", too: this may mean something.

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 20 Sep, 2021 05:38:06 Top