Trouble with HTML Email

rtdc

Registered User.
Local time
Today, 16:57
Joined
Feb 27, 2007
Messages
55
I have a problem with sending a report as HTML via Outlook 2003, or to be correct two problems.

1. With memo fields it is not taking all the text, it is not grouped so it is getting past the 255 chrs.

2. If the report goes to two or more pages then it puts a First, Previous, Next, Last hyperlink at the bottom, not that the link works.

Does anyone have an answer to stopping it doing these questions? I am going mad trying to get these emails working, I don’t want to resort to sending documents s attachments if I can help it.

My code:

Function EmailSignOffSummary()

Dim strline, strHTML

Dim OL As Outlook.Application
Dim MyItem As Outlook.MailItem
Dim Myset As Object, HEAD As Object, BOD As Object, NME As Object, A As String
A = "SignoffSummary"

Set OL = New Outlook.Application
Set MyItem = Outlook.Application.CreateItem(olMailItem)

If IsLoaded("frmInvestigation") Then
I = "SFL" & Format(Forms![frmInvestigation]![ID], "00000")
Else
I = "SFL" & Format(Forms![frmInvestigationDirect]![ID], "00000")
End If

DoCmd.OutputTo acOutputReport, "SignOffSummary", acFormatHTML, "C:\SFL\myreport.html"

Set Myset = CurrentDb.OpenRecordset("SELECT * FROM [tblemails] WHERE ((([tblemails].Mail)='" & A & "'))")
Set HEAD = Myset!

Set BOD = Myset![Body]
Set NME = Myset![to]

Open "C:\SFL\myreport.html" For Input As 1
Do While Not EOF(1)
Input #1, strline
strHTML = strHTML & strline
Loop
Close 1
' If OL2002 set the BodyFormat
If Left(OL.Version, 2) = "10" Then
MyItem.BodyFormat = olFormatHTML
End If
MyItem.HTMLBody = strHTML
MyItem.to = NME
MyItem.Subject = I & " " & HEAD
MyItem.Display

End Function

Help.:confused:
 

Users who are viewing this thread

Back
Top Bottom