A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Multiple Instances of Outlook



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 8th 06, 02:53 PM posted to microsoft.public.outlook.program_vba
John Mann
external usenet poster
 
Posts: 1
Default Multiple Instances of Outlook

I am writing an application that works with Outlook - creating an instance
of "Outlook.Application" and find that by making Outlook visible it leaves
the instance of Outlook open when I release the reference to the
application.

I make it visible by

Dim inboxFolder As Outlook.MAPIFolder
Set inboxFolder =
gOutlookApp.GetNamespace("MAPI").GetDefaultFolder( olFolderInbox)
inboxFolder.Display

Is there a way to hide Outlook again, or ensure that when I release the
instance of the object that instance of Outlook will close?

I can call the Quit method, but this appears to close all instances of
Outlook.

Note the reason I am making Outlook visible is because for some reason some
installs of Outlook 2000 do not appear to work with COM unless the
application is visible. When processing mail I get a message "Could not open
the item" - this message does not appear if the application is visible.

Note I have also tried using GetObject instead of CreateObject but this
appears to make no difference - it still creates a new instance of the
application.


Ads
  #2  
Old December 8th 06, 06:09 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Multiple Instances of Outlook

Instead of calling inboxFolder.Display, you can have something like
set Explorer = inboxFolder.GetExplorer
Explorer.Display
.....
Explorer.Close

The error is an indication that you never call Namespace.Logon. After
creating an instance of Outlook.Application, add
set NS = Application.GetNamespace("MAPI")
NS.Logon

If you get that error from Namespace.GetItemFromID, make sure you also pass
the store id as thee second (optional) parameter.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"John Mann" wrote in message
...
I am writing an application that works with Outlook - creating an instance
of "Outlook.Application" and find that by making Outlook visible it leaves
the instance of Outlook open when I release the reference to the
application.

I make it visible by

Dim inboxFolder As Outlook.MAPIFolder
Set inboxFolder =
gOutlookApp.GetNamespace("MAPI").GetDefaultFolder( olFolderInbox)
inboxFolder.Display

Is there a way to hide Outlook again, or ensure that when I release the
instance of the object that instance of Outlook will close?

I can call the Quit method, but this appears to close all instances of
Outlook.

Note the reason I am making Outlook visible is because for some reason
some installs of Outlook 2000 do not appear to work with COM unless the
application is visible. When processing mail I get a message "Could not
open the item" - this message does not appear if the application is
visible.

Note I have also tried using GetObject instead of CreateObject but this
appears to make no difference - it still creates a new instance of the
application.




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple outlook.exe instances in my Task Manager John in SoCal Outlook - General Queries 1 October 17th 06 11:06 AM
Outlook Multiple Instances Appearing? Siv Outlook - General Queries 2 June 21st 06 03:55 PM
Multiple instances of Outlook DS-NTE Outlook - General Queries 1 February 22nd 06 12:51 PM
How do I open multiple instances of Outlook with another profile? bradr98 Outlook - Installation 1 February 20th 06 08:08 PM
Multiple Outlook 2003 instances launched Jim Gilligan Outlook - General Queries 1 February 4th 06 09:39 PM


All times are GMT +1. The time now is 06:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.