If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
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.

VB6 Outlook 2007 automation

Hello,

We have a large VB6 application in our enterprise which normally occupies ~30 MB of RAM.
We have some simple outlook automation in the application, which opens a new message window.
Code reproduced here.
<<
Dim objOutlook As Outlook.Application
Dim objMailItem As Outlook.MailItem

Re: VB6 Outlook 2007 automation

@George1111

I am adding the reference. Infact, the outlook object gets created if I initialize it at the beginning of the large application (say X). The problem comes only if I initialize the outlook object after X got completely initialized and running.

The problem here is that even if I open outlook object at the beginning of X , it gets closed if the user closes outlook outside of the application. So I need the ability to create the outlook object when X is up and running.

Re: VB6 Outlook 2007 automation

He might be saying that app X loses it's Outlook object when the user closes Outlook, started after his app is running.

The problem here is that even if I open outlook object at the beginning of X , it gets closed if the user closes outlook outside of the application. So I need the ability to create the outlook object when X is up and running.

Re: VB6 Outlook 2007 automation

@dglienna
Yes. That is what I meant. The app loses it's outlook object when user closes outlook started outside the app.

@George1111
App X can create Outlook 2003 object when it's up and running. So it was never a problem. Even if the user closes outlook outside of the application, I can always create a new outlook object.
The problem comes when we try to instantiate outlook 2007 object after the app is fully loaded.

Thanks for the link. While the content there was helpful, it didn't address my immediate problem.

Re: VB6 Outlook 2007 automation

I found one reference to automating Outlook which had more than 10 instances running, but as you added an email to one of them, all 10 showed the email - this suggests that while you "think" you have 10 instances, there is in fact only one real instance - this then follows when you close one , you just may be closing ALL (which is what seems to be your problem)

Regardless ....

What may solve your problem is finding ANOTHER way to get into Outlook to do what you may want to do

Google Search on "Outlook Redemption" which is a way of working with Outlook without having to use Outlook Automation

Alternately, depending on how your email is delivered, you may be able to get by with just a simple POPMail VB6 Client (which can read your email accounts without going through Outlook)