How to Kill outlook process by vb?

Joined
Feb 17, 2006
Messages
2
Reaction score
0
HI, i'am Chris
i have a problem need for help...
i have write that program to send E mail by OutLook on Vb
but when i exit the program, the Outlook Application also still in task management, when i run program again, the task management will create Outlook Application again, so, my task management may run more then one outlook application, i want to quit the application when i exit the program, how can i do?

Dim oOApp As Outlook.Application
Dim oOMail As Outlook.MailItem
Set oOApp = CreateObject("Outlook.Application")
Set oOMail = oOApp.CreateItem(olMailItem)
With oOMail
.To = "(e-mail address removed)"
.Subject = "test"
.Body = "Testing Body"
.Attachments.Add "C:\Components.txt", olByValue, 1
.Send
End With
Set oOMail = Nothing
oOApp.Application.Quit
Set oOApp = Nothing

this is me write program.
 

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