Doflamingo
Board Regular
- Joined
- Apr 16, 2019
- Messages
- 238
Hi all,
I try to understand why the code to send an image which is in the excel sheet ''GrapheImage'' with the
Object of the email in the column A, the email adress in the column B and the message of the email in the column C
Here is the code
Any idea ?
I try to understand why the code to send an image which is in the excel sheet ''GrapheImage'' with the
Object of the email in the column A, the email adress in the column B and the message of the email in the column C
Here is the code
Code:
ra = ActiveWorkbook.Path
Sheets("GrapheImage").Copy
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs ra & "\GrapheGif.xls"
ActiveWindow.Close
'--- Envoi par mail
Dim objOL As Object
Set objOL = CreateObject("Outlook.Application")
Dim olapp As Outlook.Application
Dim msg As MailItem
Set olapp = New Outlook.Application
Set msg = olapp.CreateItem(olMailItem)
msg.To = Range("B2")
msg.Subject = Range("A2").Value
msg.Body = Range("C2")
msg.Attachments.Add Source:=ra & "\GrapheGif.xls"
msg.Send
Any idea ?