How to send email from excel

M

Mistry

Hi All

I have the following bit of code which will send the excel workbook as
an attachment. I have it enter in the subject and set the flag for
read recipt to true but how do i enter some text into the main message
body.

Application.EnableAnimations = False
Application.ScreenUpdating = False
Range("D6").Select
Userid = ActiveCell.FormulaR1C1
Range("C28").Select
Addressee = ActiveCell.FormulaR1C1
Subject = "CC:pY:INFO03: " + Userid
ActiveWorkbook.Title = Subject
ActiveWorkbook.Subject = "EPG"
Application.EnableAnimations = True
Application.ScreenUpdating = True
ActiveWorkbook.SendMail Addressee, Subject, True
MsgBox "This form has been sent to Desk Europe. A copy is stored in
your Outlook Sent Folder."
On Error GoTo 0
End Sub


Any ideas?
 
A

acampbell012

Below is a snippet of code I use to insert text and a range in to the
body of an email using Outlook. "Rangetohtml" is a routine that picks
up the inserted range.

Hope this helps.

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.FormDescription.OneOff = True
'.FormDescription.Locked = True
End With
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = Range("Vouch_Code") & " Voucher Approval Request -
Acct " & _
Application.Text(Range("Acct_1"), "####-###-####") & " - "
& _
Application.Text(Range("Voucher_Amount"), "$#,###.00") & "
- " & _
Application.Text(Right(Range("'Voucher
Form.xls'!Prepared_by"), 6), "00####")
.HTMLBody = "<br>" & "Approvers see notes at bottom." &
"<br><br>" & _
RangetoHTML & "<br><br><br><br>" &
Application.Text(Range("Acct_1"), "###########") & _
"<br><br>" & Application.Text(Range("Acct_2"), "###########") &
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top