Hello All,
I am using the below macro to send a mail but this wont send a screenshot in excel sheet. I am pasting the screenshot in excel but the screenshot is not displaying in mail. Please help me out to send a picture which is pasted in excel sheet.
Sub Mail_Workbook_1()
Dim i As Integer
i = 1
' This example sends the last saved version of the Activeworkbook object .
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
' Change the mail address and subject in the macro before you run it.
With OutMail
.To = "sanathana.samartha@socgen.com"
.CC = ""
.BCC = ""
.Subject = Cells(i, 3)
.Body = Cells(i, 5)
.Display = Cells(16, 8) ====>> This is for screenshot
'Application.SendKeys "(^v)"
'.Attachments.Add Sheets(Screenshot).Activate
'.Attachments.Sheets("Screenshot").Activate
'.Attachments.Add ActiveWorkbook.FullName
' You can add other files by uncommenting the following line.
'.Attachments.Add ("C:\test.txt")
' In place of the following statement, you can use ".Display" to
' display the mail.
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Bookmarks