Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Email code
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 |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code to send email to address within selection in Excel workbook | Excel Discussion (Misc queries) | |||
send wkbk as an email attachment with an email address copied from | Excel Discussion (Misc queries) | |||
Need help with Email Code (PLEASE) | Excel Worksheet Functions | |||
can I copy a column of email addresses, paste into email address? | New Users to Excel | |||
Transfer Email addresses from spreadsheet to email address book | Excel Discussion (Misc queries) |