Hi,
I have a beatiful piece of code here:
*******
Sub Email()
Dim myOutlook As Object
Dim myMailItem As Object
Set otlApp = CreateObject("Outlook.Application")
Set otlNewMail = otlApp.CreateItem(olMailItem)
fName = ActiveWorkbook.Path & "" & ActiveWorkbook.Name
With otlNewMail
.To = "Mister.Dinictus@Dinictuscorp.com"
.Subject = "You are soo goooood " & Date
.Body = Worksheets("GOOOOOD").Range("A1")
'.Attachments.Add fName
.Display
End With
Set otlNewMail = Nothing
Set otlApp = Nothing
Set otlAttach = Nothing
Set otlMess = Nothing
Set otlNSpace = Nothing
'otlApp.Quit
syntaxt that will actually really really send this composed mail
End Sub
**************
Now, this composes a mail and all, but does not actually SEND the mail. I want this code to also send it! Is this possible from VBA? I will probably be promted by outlook but I will look into that later.
Another thing is, I want excel to quit with a VBA commando.
Now ofcourse "ActiveWorkbook.Close" closes the workbook but what code closes excel entirely? Is this possible?? I hope so.
Please help me out and will post a reaaallly good joke as a reward. :lol
Cheers.
Din.
I have a beatiful piece of code here:
*******
Sub Email()
Dim myOutlook As Object
Dim myMailItem As Object
Set otlApp = CreateObject("Outlook.Application")
Set otlNewMail = otlApp.CreateItem(olMailItem)
fName = ActiveWorkbook.Path & "" & ActiveWorkbook.Name
With otlNewMail
.To = "Mister.Dinictus@Dinictuscorp.com"
.Subject = "You are soo goooood " & Date
.Body = Worksheets("GOOOOOD").Range("A1")
'.Attachments.Add fName
.Display
End With
Set otlNewMail = Nothing
Set otlApp = Nothing
Set otlAttach = Nothing
Set otlMess = Nothing
Set otlNSpace = Nothing
'otlApp.Quit
syntaxt that will actually really really send this composed mail
End Sub
**************
Now, this composes a mail and all, but does not actually SEND the mail. I want this code to also send it! Is this possible from VBA? I will probably be promted by outlook but I will look into that later.
Another thing is, I want excel to quit with a VBA commando.
Now ofcourse "ActiveWorkbook.Close" closes the workbook but what code closes excel entirely? Is this possible?? I hope so.
Please help me out and will post a reaaallly good joke as a reward. :lol
Cheers.
Din.