![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |