VincentCrimmins
Programmer
Hi,
I'm trying to paste a table in Excel into the body of an email, but I don't know what code is required to paste it.
I've tried the FAQ but can't see anything, any help greatly appreciated!
Code for copying the table and creating the email:
Sub Mailer()
Sheets("Summary").Select
ActiveSheet.Range("Orders").Select
Selection.Copy
Dim objol As New Outlook.Application
Dim objmail As MailItem
Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olmailitem)
With objmail
.To = "" 'enter in here the email address
.CC = ""
.Subject = "Orders" & dname
.Body = "Hello" & _
vbCrLf & "" & _
vbCrLf & "END/" & vbCrLf
.NoAging = True
.Attachments.Add PathName
.display
End With
Set objmail = Nothing
Set objol = Nothing
SendKeys "%{s}", True
End Sub
I'm trying to paste a table in Excel into the body of an email, but I don't know what code is required to paste it.
I've tried the FAQ but can't see anything, any help greatly appreciated!
Code for copying the table and creating the email:
Sub Mailer()
Sheets("Summary").Select
ActiveSheet.Range("Orders").Select
Selection.Copy
Dim objol As New Outlook.Application
Dim objmail As MailItem
Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olmailitem)
With objmail
.To = "" 'enter in here the email address
.CC = ""
.Subject = "Orders" & dname
.Body = "Hello" & _
vbCrLf & "" & _
vbCrLf & "END/" & vbCrLf
.NoAging = True
.Attachments.Add PathName
.display
End With
Set objmail = Nothing
Set objol = Nothing
SendKeys "%{s}", True
End Sub