Sub EmailFromExcel()
Dim olApp As Outlook.Application, olMail As
Outlook.MailItem
Dim Rng As Range
Dim objOLAttach As Outlook.Attachment
iPath = 'YOUR FILE PATH GO'S HERE
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
olMail.To = Range("to_addresses").Value 'this is a
cell reference for your 'To' email addresses
olMail.CC Range("cc_addresses").Value 'this is a cell
reference for your 'CC' email addresses
olMail.BCC = Range("bcc_addresses").Value 'this is a
cell reference for your 'BCC' email addresses
'email subject here
olMail.Subject = "REPLACE THIS TEXT WITH YOUR EMAIL
SUBJECT"
'main message here
olMail.Body = "Dear ExcelAid" _
& vbCrLf & vbCrLf & "REPLACE THIS TEXT WITH
THE BODY TEXT FOR YOUR EMAIL." _
& vbCrLf & vbCrLf & "Regards," _
& vbCrLf & vbCrLf & "ExcelAid," _
& vbCrLf & "mailto:
[email protected]"
'attachment
olMail.Attachments.Add iPath 'this will attach the
file you declared earlier.
olMail.Display 'DISPLAYS THE EMAIL
olMail.Send 'WILL AUTO SEND THE EMAIL
End Sub
You will need to have 9.0 Microsoft Outlook Object Library
checked within VB. The 9.0 may vary depending on the
version of Excel you are using.
regards
Kerry Bennett
www.excelaid.com