Hi, I want to automate a daily process of creating a new email, typing subjects and body text and adding an attachment, which I've been able to achieve. However I also copy a range of cells (C11 to O14) and paste into the email body as a picture, and this is where I am struggling.
Here's my code
So any ideas on adding the range C11 to O14 as a picture as well as the text within 'strbody'.
Thanks
Here's my code
Code:
Sub Send_Email()
Dim thisWb As Workbook
Set thisWb = ActiveWorkbook
Dim Fname As String, strbody As String, Drng As String, Email_Attach As String, _
Email_Subject, Email_Send_From, Email_Send_To, _
Email_Cc, Email_Bcc, Email_Body As String, email_body2 As String
Dim Mail_Object, Mail_Single As Variant
Dim rng
Set rng = Range("C11:O14")
Fname = Range("C1").Value
strbody = "<BODY stylefont-size:14pt;font-family:Calibri>Hello All, please see the latest Daily Data<p>\Teams with highest Sales.</BODY>"
Drng = Range("C2").Value
Email_Subject = "Daily Sales Report" & Drng
Email_Send_From = ""
Email_Send_To = ""
Email_Cc = ""
Email_Bcc = ""
Email_Body = strbody
Email_Attach = thisWb.Path & "\Daily Sales Report " & Fname & ".xlsx"
On Error GoTo debugs
Set Mail_Object = CreateObject("Outlook.Application")
Set Mail_Single = Mail_Object.CreateItem(0)
With Mail_Single
.Subject = Email_Subject
.To = Email_Send_To
.cc = Email_Cc
.BCC = Email_Bcc
.htmlBody = strbody
.attachments.Add Email_Attach
.display
End With
debugs:
If Err.Description <> "" Then MsgBox Err.Description
End Sub
So any ideas on adding the range C11 to O14 as a picture as well as the text within 'strbody'.
Thanks