Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 11
Default Adding text to email body

Hi,

I am using the code below to send an email using the email address in A1 but I cant seem to include any text in the main email.

I got this code from the below site but cannot make sense of the section at the bottom where it explains how to add text to the actual email.

http://www.rondebruin.nl/mail/folder3/mail5.htm

What ever I try, it doesnt seem to work :(

Sub Mail_Every_Worksheet()
'Working in 97-2010
Dim sh As Worksheet
Dim wb As Workbook
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim TempFilePath As String
Dim TempFileName As String
Dim I As Long

TempFilePath = Environ$("temp") & "\"

If Val(Application.Version) < 12 Then
'You use Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
Else
'You use Excel 2007-2010
FileExtStr = ".xlsm": FileFormatNum = 52
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

For Each sh In ThisWorkbook.Worksheets
If sh.Range("A2").Value Like "?*@?*.?*" Then

sh.Copy
Set wb = ActiveWorkbook

TempFileName = "NSA " _
& ThisWorkbook.Name & " " _
& Format(Now, "dd-mmm-yy h-mm-ss")

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, _
FileFormat:=FileFormatNum
On Error Resume Next
For I = 1 To 3
.SendMail sh.Range("A2").Value, _
"Reminder"
If Err.Number = 0 Then Exit For
Next I
On Error GoTo 0
.Close SaveChanges:=False
End With

'Delete the file you have send
Kill TempFilePath & TempFileName & FileExtStr

End If
Next sh

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub

Can anybody give me some advise please?

Many thanks
Pri
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default Adding text to email body

Here's a good place to start...

http://www.rondebruin.nl/sendmail.htm

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Multiple images in in an email body amitmehrotra123 Excel Programming 0 July 25th 12 04:45 AM
Lotus Notes email from Excel - formatting body text. Jay Petrulis[_2_] Excel Programming 0 August 10th 07 05:03 PM
Trying to send an email with body text, to a range of cells [email protected] Excel Discussion (Misc queries) 1 November 29th 06 12:28 AM
Email Body Text & Signature Darrell Lankford Excel Programming 1 April 7th 06 05:50 PM
Adding text to body of email with workbook attached. aph Excel Programming 3 December 5th 05 03:11 PM


All times are GMT +1. The time now is 04:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"