Outlook Calendar’s collapsed/expanded groups mode is not saved any more

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

Outlook Calendar’s collapsed/expanded groups mode is not saved any more
Problem with folders status not saved (expanded or collapsed) 
Cleber Campos




Posts: 8
Joined: 2015-04-17
Hi,
I just open the same topic, because I believe that the previous one was closed due no reply from my side

https://www.add-in-express.com/forum/read.php?FID=5&TID=15041

So, I created a video to demonstrate the error
The video shows that “My Calendars” folder is collapsed when I close Outlook. When, I open again is expanded. Sometimes the opposite happens.
Video at box.com that shows the problem

I can reproduce the problem in Outlook 2013/2016 and 2019

Somehow, the add-in express changes the behavior of the Outlook.
In my VSTO add-in if I remove the initialization of add-in, in summary not using the add-in code anymore in my add-in (I use an specific form reading in the top of the e-mail) the Outlook works as expected.
The problem is not my add-in, but some action performed by add-in express code.

To stop use add-in express I just comment the following:

//this.FormsManager = AddinExpress.OL.ADXOlFormsManager.CurrentInstance;
//this.FormsManager.OnInitialize += new   AddinExpress.OL.ADXOlFormsManager.OnComponentInitialize_EventHandler(this.FormsManager_OnInitialize);
//this.FormsManager.Initialize(this);
Cleber Campos - Brasil
Posted 06 Dec, 2018 12:23:52 Top
Andrei Smolin


Add-in Express team


Posts: 15826
Joined: 2006-05-11
Hello Cleber,

We are unable to reproduce this issue using Add-in Express Outlook Regions build 4.1.2655. Our guys did reproduce this issue with version 3. Could you please check if the issue exists for you?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 14 Dec, 2018 09:18:58 Top
Cleber Campos




Posts: 8
Joined: 2015-04-17
Hi,

we were using version 4.0.2650. Now we have installed the new version 4.1.2655 and made a new build using it. Unfortunately, the problem still happens.

Once again I tried to progressively remove bits of code to find out what could be causing the problem. The only thing that could make the problem go away was removing the line
this.FormsManager.Initialize(this);

from ThisAddin.cs
Cleber Campos - Brasil
Posted 17 Dec, 2018 12:55:54 Top
Dmitry Kostochko


Add-in Express team


Posts: 2799
Joined: 2004-04-05
Hi Cleber,

We have just re-tested this issue on two different machines, please see our results below:
1. Windows 10 x64 + Outlook 2016 (16.0.11126.20010) 32-bit. Calendar groups are always expanded after Outlook restart.
2. Windows 10 x64 + Outlook 2016 (16.0.11208.20000) 32-bit. Calendar groups preserve their state (collapsed) after Outlook restart.

Note, in both cases no COM add-ins were loaded into Outlook, we disabled all of them including the standard ones.

So, it seems to us that the issue does not depend on an Outlook add-in, most probably it depends on an Outlook version/build.

Please let me know what build of Outlook 2016 you use in your tests.
Posted 18 Dec, 2018 04:20:11 Top
Cleber Campos




Posts: 8
Joined: 2015-04-17
Hi Dmitry,

I double check here, I used the latest version from OLK - Windows 10 x64 + Outlook 2016 (16.0.11126.20192) 32-bit. Problem is still there if I load my plugin based in the add-in express.

Using the based add-in, the previous state of the folders is not preserved. Note, I am not talking about only ‘expanded’. If in the first time that add-in is load the folders are collapsed, that means that it will always be opened collapsed, I will not able to open Outlook with my calendar folders expanded anymore.

And, without add-in the Outlook works as expected. The previous state of calendar folders is saved and restore in the next session. E.g. One folder expanded and another one collapsed.
Cleber Campos - Brasil
Posted 17 Jan, 2019 08:47:36 Top
Andrei Smolin


Add-in Express team


Posts: 15826
Joined: 2006-05-11
Hello Cleber,

We can't reproduce this issue. We developed a theory that the issue is a result of some call to the Outlook object model made in some event. Actually, we had such issues before:
- accessing the folder in some event (was it Explorer.Activate?) effectively disabled the built-in button that the user uses to load web-based add-ons
- accessing CurrentView in FoldersSwitch caused crashes on some machines.

If the issue isn't reproducible using a new empty add-in project, you can try to comment out blocks of your code.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 21 Jan, 2019 08:44:25 Top
Cleber Campos




Posts: 8
Joined: 2015-04-17
Hi again,

after removing practically every code we had in our plugin, i was able to find one line that was causing the problem.

Here is a HelloWorld project:
https://www.dropbox.com/s/ms5b5kgkq0jeu7b/TestPluginFolderState.zip?dl=0

Inside ADXOlForm1.cs you will find an event handler that does nothing but grab a reference to the active explorer (line 21)

var x = Globals.ThisAddIn.Application.ActiveExplorer();


If you comment that line, the problem goes away.
If you uncomment it, the problem comes back.
I tested it using Outlook 2016 x64.

I honestly have no idea why it happens. Maybe you guys could shed some light upon it.

Unfortunately, in our real plug-in there is something else triggering this problem, because removing that line does not help. I will keep investigating.
Cleber Campos - Brasil
Posted 18 Feb, 2019 09:43:21 Top
Andrei Smolin


Add-in Express team


Posts: 15826
Joined: 2006-05-11
Hello Cleber,

Will the issue persist if you release the COM object referenced by x?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 19 Feb, 2019 03:28:14 Top
Cleber Campos




Posts: 8
Joined: 2015-04-17
Thank you very much, that solves it.
Calling Marshal.ReleaseComObject on the reference solves the problem.

I actually will have a lot of work to go after every spot where Application.ActiveExplorer() was being used, but now we know how to fix it.

Thank you very much!
Cleber Campos - Brasil
Posted 19 Feb, 2019 19:22:17 Top
Andrei Smolin


Add-in Express team


Posts: 15826
Joined: 2006-05-11
Great!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 20 Feb, 2019 01:10:43 Top