Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pasting from Excel to the body of an Outlook Email

Status
Not open for further replies.

VincentCrimmins

Programmer
Jan 16, 2008
37
IE
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
 
Apologies, please ignore this thread, I found the answer using 'Search'.

Thanks...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top