Control order of forms in same region in Outlook Inspector

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

Control order of forms in same region in Outlook Inspector
User have multiple Addins which show form in same region, need to show form from another addin by default 
Yevhen Lysakov




Posts: 10
Joined: 2021-06-02
I have a problem with our Outlook addin.
We add our pane in Inspector in TopReadingPane location.
Now it appeared that users also have another addin installed - "Microsoft Azure Information Protection Unified Labeling Client", which also adds a pane to same locaiton.
As result, pane from our addin is always showed on top when user creates new email, and request from user is to show pane from different addin by deault.
Pls see the screenshot:
[img]https://ibb.co/9sPDGL2[/img]

So the question is how can we control the order/priority in which panes from different addins are displayed, and what we can do to show pane from another addin by default?

Any advise would be helpful.
Posted 08 Nov, 2021 09:58:27 Top
Andrei Smolin


Add-in Express team


Posts: 18523
Joined: 2006-05-11
Hello Yevhen,

There's no direct way to control the load order. The approach below introduces a small delay before your form shows; this lets other forms load first. The project is at http://temp.add-in-express.com/support/MyAddin23-DelayBeforeShow.zip. The timer used is a same-thread timer; strongly recommended.

        bool visibility = false;

        private void ADXOlForm1_ADXBeforeFormShow()
        {
            Visible = visibility;

            var timer = new System.Windows.Forms.Timer();
            timer.Interval = 10;
            timer.Tick += (sender, e) =>
            {
                try
                {
                    visibility = true;
                    this.Item.ApplyTo(this.ExplorerObj);
                }
                finally { visibility = false; }
                timer.Enabled = false;
                timer.Dispose();
            };
            timer.Enabled = true;
        }


Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Nov, 2021 06:15:46 Top
Yevhen Lysakov




Posts: 10
Joined: 2021-06-02
Proposed approach worked like a charm when email is opened in separate window (including creation of new mail). With one small correction - I've used InspectorObj instead of ExplorerObj. And added additional check to decide when to apply this "fix"
 
this.Item.ApplyTo(this.InspectorObj);


Many thanks for support!
Posted 09 Nov, 2021 07:31:50 Top
Andrei Smolin


Add-in Express team


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

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Nov, 2021 07:40:17 Top
Yevhen Lysakov




Posts: 10
Joined: 2021-06-02
Hi Andrei!

Spotted strange UI glitch with proposed solution (10ms delay to show our addin):
[img]https://ibb.co/2ShZVz1[/img]
(our addin pane is drawn on top of "File" menu page)

Steps:
crate new mail, in opened window quickly click on "File" menu, then on "Back arrow" and again on "File".

Could you please suggest some fix for such behavior?
Posted 11 Nov, 2021 09:57:23 Top