>Question: this code continues to open a new Outlook. If I'm sending several
>emails, then I end up with several versions of Outlook open. I know I can >close the the session...just check to see if there is a way to open the
>current session.
>
>Each time I run the procedure, it opens another Outlook (down in the task
>bar). If I have already got outlook open, I want it to use that one. I
>haven't been able to find a why to do that. So for now I just open it and
>then close it when I'm done sending the email.
>
>I would rather open it if it is not open and then leave it open when I'm
>done and let the user decide to close it. If it is open (which the user has
>done), I want to make use of that particular session even thought I don't
>have an object reference to it (yet).
>
>Does this make sense?
>
>Thanks.
>
>Trish
>
Are you in Win95, 98, NT, or 2000? Just curious.
I'm in NT 4.0, and I've dealt with the very issue you're talking about.
For me, a reference to ActiveExplorer handled it perfectly ("See below" :] ).
Even when Outlook is already running, just calling
oApplication = CREATEOBJECT("Outlook.Application")
oNameSpace = oApplication.GetNameSpace("MAPI")
has not opened a new Outlook window (Explorer) for me.
I think what is happening with the code to which you referred from the Universal Thread posting is that it's redirecting the session to the Contacts folder and THEN opening an Explorer (which would indeed create a whole new window).
Instead, if Outlook is already running and you DON'T want those extra windows, try (after 'oApplication = ... ' and 'oNameSpace = .... ' as above):
oExplorer = oApplication.ActiveExplorer()
oExplorer.Display()
This will only work if Outlook IS already running and is on the taskbar.
Hope this helps.
Jared M Anderson
Interactive Data Systems, Inc.
janderson@idevgroup.com