G
Guest
Hi - i have searched and searched and put together this bit of code. It
works fine but however i structure it (and believe me i've tried different
ways) i can't get the body of the email formatted with the line breaks i
need. It all comes out in one string! I did just put it in as a string with
vbCrLf in and also trying chr(10) etc but to no avail!
Please help!
Dim EmailAddress As String
EmailAddress = Me!email
Dim olApp As Outlook.Application
Dim objMail As MailItem
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
Dim bod As String
Dim fso As FileSystemObject
Dim strbody As TextStream
Set fso = New FileSystemObject
Set strbody = fso.OpenTextFile("C:\Documents and Settings\Helsi\My
Documents\Cambridge - PWL\welcome.txt", ForReading)
bod = strbody.ReadAll
strbody.Close
With objMail
.BodyFormat = olFormatHTML
.HTMLBody = bod
.Display
.To = EmailAddress
.Subject = "Welcome To Cambridge"
End With
works fine but however i structure it (and believe me i've tried different
ways) i can't get the body of the email formatted with the line breaks i
need. It all comes out in one string! I did just put it in as a string with
vbCrLf in and also trying chr(10) etc but to no avail!
Please help!
Dim EmailAddress As String
EmailAddress = Me!email
Dim olApp As Outlook.Application
Dim objMail As MailItem
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
Dim bod As String
Dim fso As FileSystemObject
Dim strbody As TextStream
Set fso = New FileSystemObject
Set strbody = fso.OpenTextFile("C:\Documents and Settings\Helsi\My
Documents\Cambridge - PWL\welcome.txt", ForReading)
bod = strbody.ReadAll
strbody.Close
With objMail
.BodyFormat = olFormatHTML
.HTMLBody = bod
.Display
.To = EmailAddress
.Subject = "Welcome To Cambridge"
End With