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
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