none
GetExplorer method is opening Outlook window in Outlook 2007. RRS feed

  • Question

  • When calling the GetExplorer method from an instance of Outlook 2007 on version "2007(12.0.6562.5003) SP2 <stockticker>MSO</stockticker>(12.0.6562.5003)" or above, an outlook explorer window is displayed.  From my tests, this seems to be independent of the Operating System, the OS Service Pack, and the hardware.

    This does not happen on version "2007(12.0.6550.5001) SP2 <stockticker>MSO</stockticker>(12.0.6562.5003)" or below.  It also does not occur in Outlook 2010, Outlook 2003, or Outlook 2002 in any known version.

        Dim OutlookApp As Object
        Dim OutlookNameSpace As Object
        Dim OutlookFolder As Object
        Dim OutlookExplorer As Object
        Const olFolderInbox = 6
        Const olFolderDisplayNoNavigation = 2

        Set OutlookApp = CreateObject("Outlook.Application")
        Set OutlookNameSpace = OutlookApp.GetNamespace("MAPI")
        Set OutlookFolder = OutlookNameSpace.GetDefaultFolder(olFolderInbox)
        Set OutlookExplorer = OutlookFolder.GetExplorer(olFolderDisplayNoNavigation)

    Note that others are experiencing this as well, but it does not seem to have made it's way to the office group.  See: http://social.msdn.microsoft.com/Forums/en-US/outlookdev/thread/09dbf48c-6a0d-441b-bd57-0950575a78f1

    Note that I have tried the December 2011 cumulative update for Outlook 2007 and it does not fix this issue.
    Also note that this does NOT occur in Outlook 2002 (XP), 2003, or 2010.

    Someone had logged this to microsoft connect, but they closed it because "it is out of their department" (it was marked as "Resolved as External")

    I am unsure what to do about this.

    Wednesday, February 15, 2012 4:58 PM

Answers

  • Sorry, I just saw this thread. This is actually scheduled to be fixed in the Feb. 2012 Cumulative Update, which should be released next Tuesday.

    Bill Jacob - Microsoft Customer Service & Support - Developer Messaging

    Tuesday, February 21, 2012 3:26 PM
    Moderator
  • Hi Shaggee,

    I'm sorry for the confusion, that was my mistake. I see now that February's Outlook 2007 update hasn't released yet so there must be some unexpected delay. I don't know when it will be available, but when it is, the KB article for that will be http://support.microsoft.com/kb/2597964. Please check that link periodically and when it resolves, it should have the info for obtaining the fix.


    Bill Jacob - Microsoft Customer Service & Support - Developer Messaging

    • Marked as answer by MD.seradex Thursday, March 8, 2012 1:13 AM
    Monday, March 5, 2012 5:39 PM
    Moderator

All replies

  • What are you doing with the returned Explorer object?


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

    Wednesday, February 15, 2012 6:26 PM
  • I am currently doing nothing with that object expect storing it in a global variable.  It is simply used to prevent outlook from quiting when another visible outlook window is closed.
    Wednesday, February 15, 2012 6:36 PM
  • Can you use Application.ActiveExplorer instead?


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

    Wednesday, February 15, 2012 6:38 PM
  • Using the above code, the ActiveExplorer is null, unless, perhaps, the user already has an instance of Outlook open, but I cannot guarantee that.  Also, if I did, it would point at an explorer object that I did not create, so it probably wouldn't care that I have a reference to it.

    Note that my equivalent is "OutlookApp.ActiveExplorer".

    Thursday, February 16, 2012 12:30 AM
  • Can you rearchitect your code to avoid always holding s pointer to an Outlook object?


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

    Thursday, February 16, 2012 4:59 PM
  • Unfortunately no.  If I do not hold on to the pointer, then someone else can close Outlook which is exactly what we want to avoid.  Also, if we display a message from the instance of Outlook we opened, when the user closes the message, Outllook will shut down unless we hold on to the pointer.
    Thursday, February 16, 2012 5:49 PM
  • My point is that why do you want to avoid closing Outlook if that is what the user wants?

    MS went out of their way in Outlook 2007 and especially 2010 to make sure outlook.exe never hangs aroudn if the user explicity closed it. Even if you fix this scenario, you can be sure MS will close the loophole with the next version or service pack.

    What does your app do? Why not create a new instance of Outlook.Application on demand when you need it and release it as soon as you are done?


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

    Thursday, February 16, 2012 6:10 PM
  • Unfortunately, we cannot handle this another way as we are using a 3rd party control that interfaces with outlook to display, interact with and summarize information from outlook.  It is similar to the outlook view control.  We would need to completely create that control from the ground up.

    It is unfortunate that Microsoft purposely broke this for developers.  To me in this case it feels like allowing outlook to close because a user decides to close it is akin to allowing csrss.exe to because a user decides to close it.  Besides, this is not the case here.  They did not decide to close Outlook itself.  They only decided to close the one visible window from Outlook. 

    I think that most people would agree that when users install and use an application that requires a com object to be open, then they expect it to stay open even if they close a window which that com object has displayed.

    Thursday, February 16, 2012 9:57 PM
  • I think we have missed the main point which is that this specific problem only occurs on recent versions of Outlook 2007.  It does not occur on any other known versions of Outlook at this time.
    Thursday, February 16, 2012 9:59 PM
  • Hi Dmitry,

    Do you have any work round of that?

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, February 20, 2012 7:54 AM
    Moderator
  • I do not see any workarounds, an I would argue this is the desired behavior that will not be fixed.

    Whether this is a good or bad behavior is beyond the point - MS has made a decision that Outlook is supposed to be closed as soon as its last window is closed  even if there are still outstanding references to OOM objects.


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

    Monday, February 20, 2012 6:48 PM
  • I agree that I do not see any good workarounds currently, however I believe that I did recently read something about a registry setting to force the previous behaviour of not closing, but I am unsure atm.  I am reluctant to do this as it affects more than just our application.

    I understand that Microsoft has taken the position that closing Outlook as soon as the last visible window is closed is desired behaiour, I just wish they didn't. 
    If you mean that that will not "fix" that specific behaviour, then I understand, even if I do not agree with it.
    If you mean that that will not "fix" the behaviour of GetExplorer creating a visible window in 2007, then I cannot agree as it does not do this in the versions of 2010 that we have tested.

    I expect that you do mean the closing behaviour and not necessarily this new unique "window being made visible" behaviour.

    I do appreciate everyone's time and attempts to assist me with this.  If anyone has any further information, please respond.

    Thank You

    Shaggee


    • Edited by MD.seradex Monday, February 20, 2012 9:23 PM
    Monday, February 20, 2012 9:21 PM
  • Hi Shaggee,

    I think This thread is beyond the support capability on forum, you may contact professional phone support to resolve the issue. If they confirm this as known issue, you will not be charged.

    Have a good day,

    Tom



    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, February 21, 2012 3:07 AM
    Moderator
  • Sorry, I just saw this thread. This is actually scheduled to be fixed in the Feb. 2012 Cumulative Update, which should be released next Tuesday.

    Bill Jacob - Microsoft Customer Service & Support - Developer Messaging

    Tuesday, February 21, 2012 3:26 PM
    Moderator
  • Sorry, I just saw this thread. This is actually scheduled to be fixed in the Feb. 2012 Cumulative Update, which should be released next Tuesday.

    Bill Jacob - Microsoft Customer Service & Support - Developer Messaging

    Hi Bill,

    I just looked for an update for this and none seems to be available.  Can you let us know when this will be available for download?

    Thanks,

    Shaggee

    Saturday, March 3, 2012 5:11 PM
  • Hi Shaggee,

    The update for this issue released on Tuesday, here is the KB article for your reference:

    2597137 Description of the Outlook 2010 hotfix package (x86Outlook-x-none.msp, x64 Outlook-x-none.msp): February 28, 2012

    http://support.microsoft.com/kb/2597137


    Bill Jacob - Microsoft Customer Service & Support - Developer Messaging

    Monday, March 5, 2012 2:48 AM
    Moderator
  • Hi Bill,

    Thanks for the quick response, but my issue was with 2007 not 2010.  Also, I cannot find anything in that knowledgebase/support article that refers to my problem (GetExplorer method is opening/displaying Outlook window in Outlook 2007) even indirectly (inference).

    Do you mean that calling GetExplorer in Outlook 2010 now makes an Outlook window visible with this patch, because that would be even worse for me and my clients.

    I appreciate your assistance with this and look forward to hearing from you.

    Shaggee

    Monday, March 5, 2012 5:29 PM
  • Hi Shaggee,

    I'm sorry for the confusion, that was my mistake. I see now that February's Outlook 2007 update hasn't released yet so there must be some unexpected delay. I don't know when it will be available, but when it is, the KB article for that will be http://support.microsoft.com/kb/2597964. Please check that link periodically and when it resolves, it should have the info for obtaining the fix.


    Bill Jacob - Microsoft Customer Service & Support - Developer Messaging

    • Marked as answer by MD.seradex Thursday, March 8, 2012 1:13 AM
    Monday, March 5, 2012 5:39 PM
    Moderator
  • Hi Bill,

    Thank you for all your assistance with this issue.  I greatly appreciate it.

    I only have one issue remaining with this, one of documentation.  There appears to be an error in the KB article.
    The article states "an additional maximized Windows Internet Explorer window appears" when it is actually an additional Outlook window that appears.

    I believe that this is a simple error on their part, but I do not know for certain as there amy be another issue that I have not detected with this.

    Anyway, thanks again for your assistance.

    Have a good day.

    Shaggie

    Thursday, March 8, 2012 1:19 AM