Strange behaviour using BeforeIdMso for RibbonTab

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

Strange behaviour using BeforeIdMso for RibbonTab
 
Mike VE




Posts: 168
Joined: 2007-09-09
Hi
I have a custom ribbon tab that I want to be selected by default when the user views an Outlook calendar. I have set the RibbonTab's BefireIdMso property to TabCalendar. When Outlook starts showing the Inbox the default Home tab for mail is selected and my tab is to its right. When I click to change to a calendar my custom tab is selected and the Home tab for Mail Calendars is to its right. This is just what I want. The problem comes if I then change to People or Tasks. My ribbon tab stays selected (although a group containing buttons to change the calendar view disappears) and the default Home tab for People or Tasks is to the right, unselected.


The behaviour I expected and want is that for folder other than calendar folders the normal default tab is selected and my tab is just available on the ribbon bar.


If there is no way round this strange behaviour perhaps I could just make the calendar-specific custom ribbon disappear for non calendar folders with some code in the ExplorerFolderSwitch event. What would be the best way to do this?
Posted 18 May, 2018 04:13:43 Top
Andrei Smolin


Add-in Express team


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

You need to use two ADXRibbonTab components. As to showing/hiding them, I suggest using ExplorerBeforeFolderSwitch to check the target folder's MAPIFolder.DefaultItemType property (see https://msdn.microsoft.com/en-us/VBA/Outlook-VBA/articles/folder-defaultitemtype-property-outlook) and decide which of the tabs should be visible.


Andrei Smolin
Add-in Express Team Leader
Posted 18 May, 2018 04:35:54 Top
Mike VE




Posts: 168
Joined: 2007-09-09
That works well. Thanks Andrei
Posted 18 May, 2018 09:42:59 Top
Andrei Smolin


Add-in Express team


Posts: 18844
Joined: 2006-05-11
You are welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 18 May, 2018 09:51:34 Top