HTML email from access

gmc2k2

Registered User.
Local time
Today, 19:07
Joined
Oct 7, 2008
Messages
21
Hi All,
ive searched the forums but nothing which meets what i need, i have some code which creates a HTML email from button click using fields within my db, the problem being i need the email to be quite long and VBA is not letting write more than 25 lines on an email using the _ and i have approximately 42 lines of html email, can any of you help me with any ideas on this? i need the email to be formatted and styled and spaces between certain text using vbNewLine and my signature at the bottom.

I'm also going to be attaching a document (test document at moment)

could i possibly extract the data from a word document that has the formatting i would like the email to look like? any help on this would be appreciated.

the code i'm using right now:
Private Sub Command41_Click()
Dim OApp As Object, OMail As Object, signature As String

strBody = "<br>Please ensure that the details below are correct.<br>" & vbCrLf

Set OApp = CreateObject("Outlook.Application")
Set OMail = OApp.CreateItem(0)
With OMail
.Display
End With
signature = OMail.HTMLBody
With OMail
.To = EmailAddress
.Subject = "Reference: " & Me![productssubform].Form![Ref]
.Attachments.Add ("C:\Proj\Test.txt")
.HTMLBody = strBody & vbNewLine & signature
'.Send
End With
Set OMail = Nothing
Set OApp = Nothing
End Sub
 
Are you talking about line continuation (& _) like..
Code:
strBody = "<HTML><BODY>Hello World !<BR/>" & _
          "<P>How are you spending the Chinese New Year ! <BR/>" & _
          "</BODY></HTML>"
Or the actual HTML Body? I am not aware of limitation in the body of email. Although line continuation is known, you can avoid this by concatenation.
Code:
strBody = "<HTML><BODY>Hello World !<BR/>"
strBody = strBody  & "<P>How are you spending the Chinese New Year ! <BR/>" 
strBody = strBody  & "</BODY></HTML>"
 
yes line continuation is what i meant, i couldnt think what it was called :( ah ok i understand :) not i have to try and style 42 lines using the above method haha, here we go!!!

thank you so much pr2 it means a lot...and saved another headache
 

Users who are viewing this thread

Back
Top Bottom