Outlook region is hidden when switching mail folders

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

Outlook region is hidden when switching mail folders
My form is hidden for a moment then displayed again when i switch to another mail folder in outlook 
mitchell balsam

Posts: 8
Joined: 2017-01-27

I have an Outlook add-in that shows a region on top of the standard outlook folder view

I create the region like this

MessageViewRegion = new ADXOlFormsCollectionItem();
MessageViewRegion.ExplorerLayout = ADXOlExplorerLayout.TopSubpane;
MessageViewRegion.ExplorerItemTypes = ADXOlExplorerItemTypes.olMailItem;
MessageViewRegion.ExplorerMessageClass = "IPM.Note";
MessageViewRegion.InspectorLayout = ADXOlInspectorLayout.TopSubpane;
MessageViewRegion.InspectorItemTypes = ADXOlInspectorItemTypes.olMail;
MessageViewRegion.InspectorMessageClass = "IPM.Note";
MessageViewRegion.InspectorMode = ADXOlInspectorMode.Read;
MessageViewRegion.DefaultRegionState = ADXRegionState.Hidden;
MessageViewRegion.AlwaysShowHeader = false;
MessageViewRegion.Splitter = ADXOlSplitterBehavior.Standard;
MessageViewRegion.CloseButton = false;
MessageViewRegion.UseOfficeThemeForBackground = true;
MessageViewRegion.FormClassName = typeof(MyMessageList).FullName;
MessageViewRegion.FolderName = "*";
MessageViewRegion.Cached = ADXOlCachingStrategy.OneInstanceForAllFolders;


This works fine and when i show the region it replaces the standard folder view with my own custom version

However, i have noticed that if i select a mail folder, my region is hidden momentarely and then it's made visible again

On my custom class constructor i do this

this.ADXBeforeFormShow += OnBeforeFormShow;
this.ADXAfterFormHide += OnAfterFormHide;
this.ADXFolderSwitch += OnFolderSwitch;

On the outlook add-in startup code i subscribe for BeforeFolderSwitch

Application.ActiveExplorer().BeforeFolderSwitch += OnBeforeFolderSwitch;

I can see that if i click on a mail folder or select it programatically the following sequence occurs:

1. OnBeforeFolderSwitch
2. OnAfterFormHide
3. OnBeforeFormShow
4. OnFolderSwitch

The form is hidden and then displayed again without any interaction with my code

This causes a glitch which allows the standard folder view to show for a few milliseconds before returning to my form and my own content

Is this something expected when having a region on top of the standard folder view?

If so, are you aware of any workaround to this issue?

Posted 04 Jan, 2018 13:57:55 Top
Dmitry Kostochko

Add-in Express team

Posts: 2769
Joined: 2004-04-05
Hi Mitchell,

Thank you for the detailed description. The behavior you described is is absolutely normal because Outlook recreates its own windows (list of items) when you switch between folders. So, we need to hide your TopSubpane form and then show it again.

As a workaround, you can try to use the DockTop layout instead of TopSubpane.
Posted 05 Jan, 2018 04:39:05 Top