none
GetExplorer() causing Outlook window to open in recent update to Outlook 2016 32-bit RRS feed

  • Question

  • Please forgive me if this is not the correct forum for this, but I'm not sure where else to report it. 

    I maintain a fairly popular app that allows you to "pin" Outlook views on your desktop.  For reference, the app is here: https://outlookonthedesktop.com.

    It uses the Outlook View Control to do most of the heavy lifting.  As of a very recent update to Outlook 2016, a call to GetExplorer() now opens up the Outlook window and brings it into view, whereas it never used to do this.  Here's the code that the app uses that causes this behavior:

    OutlookApp = new Application();
    OutlookNameSpace = OutlookApp.GetNamespace("MAPI");
    
    // Before we do anything else, wait for the RPC server to be available, as the program will crash if it's not.
    // This is especially likely when OotD is set to start with windows.
    if (!IsRPCServerAvailable(OutlookNameSpace)) return;
    
    OutlookFolder = OutlookNameSpace.GetDefaultFolder(OlDefaultFolders.olFolderCalendar);
    
    // WORKAROUND: Beginning with Outlook 2007 SP2, Microsoft decided to kill all outlook instances 
    // when opening and closing an item from the view control, even though the view control was still running.
    // The only way I've found to work around it and keep the view control from crashing after opening an item,
    // is to get this global instance of the active explorer and keep it going until the user closes the app.
    OutlookExplorer = OutlookFolder.GetExplorer();

    The last line is what causes the full blown Outlook app to popup now. As noted in the comments above, the reason I had to put that in there in the first place is because if I didn't hold on to a reference of the OutlookExplorer, the view control would stop working as soon as you opened up an Outlook item (such as mail message, calendar details, etc) and then closed it.

    The version of Outlook that I'm using currently is: 16.0.9226.2114 32-bit.  The same issue does not appear to affect 64-bit Outlook.

    Is this a bug? or the new default behavior?


    Saturday, May 19, 2018 3:16 PM

All replies

  • I cannot reproduce this behavior with the following script (standalone VBS file) under Outlook 16.0.93330.2014

    set app = createobject("outlook.application")
    set ns = app.GetNamespace("MAPI")
    ns.Logon
    set f = ns.GetDefaultFolder(6)
    set insp = f.GetExplorer
    MsgBox f.Items.Count


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Saturday, May 19, 2018 4:29 PM
  • Hello,

    Looks like a bug. See GetExplorer() causing Outlook window to open in recent update to Outlook 2016 for more information.

    Outlook Insider has an option to directly provide your feedback to Office developers. Have you tried reporting about the issue to the Office team?

    FYI Please don't create duplicates on the forum. Instead, you may continue posting to the same forum thread created by you earlier.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Saturday, May 19, 2018 10:32 PM
  • When I posted on Office Insiders, they asked me to post here.  My apologies, I didn't realize this was the exact same forum I posted in earlier. Eugene, can you point me to where that Outlook Insider bug reporting option is exactly?  Feel free to delete this post as well, since I can't seem to do it.
    • Edited by mscrivo Sunday, May 20, 2018 3:12 PM
    Sunday, May 20, 2018 3:02 PM
  • Hello mscrivo,

    You could try to revert your office to a previous version which works in past. If it could still work in a previous version, the issue is caused by Outlook update and if so I would suggest you keep your office in the previous version and feedback the issue to Office and wait for next version.

    By the way, the latest version for Office is Version 1804 (Build 9226.2156) now. You could try to update to the latest version to check if the issue exist now.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 21, 2018 8:37 AM