Thread: Email code
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Email code

Use the outlook object..

Refer the below link for help
http://www.rondebruin.nl/mail/folder2/mail1.htm
--
If this post helps click Yes
---------------
Jacob Skaria


"ozhunter" wrote:

I have the following VBA code that works, but I would like to avoid having to
click the OE message box that asks if you want to send the email when you run
the code. I was also wondering if you can specify text for the body of the
email, not something that changes all the time, it will be the same text each
time.

Sheets("Pay Slip").Visible = True
Sheets("Pay Slip").Select
Sheets("Pay Slip").Copy
Range("A1:G17").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("a1").Select
ActiveWorkbook.SendMail ", Subject:="Pay
Slip for Adam Brown - Claim No 16420EML"
ActiveWorkbook.Close SaveChanges:=False
Sheets("Pay Slip").Select
Sheets("Pay Slip").Visible = False


End Sub

Any help would be appreciated