Hi guys
The following code sends an attachment with the email to different recipients. Is it possible instead of attaching the sheet with the email, Just include it in the body part of the email. I mean where we write other text like "Hello How r u? " and then the data of sheet11 will come after it.
Public Function SendOneSheet(a As String)
Dim olApp As Outlook.Application
Dim olMail As MailItem
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
ThisWorkbook.Worksheets("sheet11").Copy
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & _
"MI.xls"
With olMail
.Recipients.Add " "
.Subject = a
.Body = "Please find attached the spreadsheet showing the information" & vbCrLf
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
MsgBox "The email has been sent"
ActiveWorkbook.Close False
Kill ThisWorkbook.Path & "\" & "MI.xls"
Set olMail = Nothing
Set olApp = Nothing
End Function
Bookmarks