Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / May 2007

Tip: Looking for answers? Try searching our database.

Send email from Access 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hdpink - 11 May 2007 12:21 GMT
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
S.Y.M. Wong-A-Ton - 12 May 2007 03:52 GMT
Did you also try "<BR>"?
---
S.Y.M. Wong-A-Ton

> 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
[quoted text clipped - 29 lines]
>    
>       End With
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.