Outlook Processes remain in memory (automation)

R

RMB

Using the OOM in VB to send e-mail with the following code. The problem is
that each call to the function starts an outlook process, and after
completing the outlook process remains in memory.

Any clues why outlook does not go away after the function completes? Any
solutions to getting outlook to go away? We tried calling the "Quit" method,
but this does not help.

'Create oObjects
Dim myOlApp As Object
Dim myMailItem As Object

Set myOlApp = CreateObj("Outlook.Application")
Set myMailItem = myOlApp.CreateItem(olMailItem)

myMailItem.To = eAddress
myMailItem.CC = Trim(eAddressCC)
myMailItem.Subject = eSubject

If eAttach <> "" Then myMailItem.Attachments.Add eAttach

myMailItem.Body = eText
myMailItem.Send

Set myMailItem = Nothing
Set myOlApp = Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top