RTF emailing as Plain Text

Timoty

Registered User.
Local time
Today, 18:20
Joined
Jul 29, 2003
Messages
105
If anyone can give me a hand it would be appreciated. This code was working prior to my upgrade to Access 2003. Now, my email ends up containing all the RTF as plain text with code along with the narative as opposed to a nicely formated RTF email.

The code exports a form to an RTF file and then takes the RTF information and puts it into the email. I had help with the code from someone on this forum so I don't really understand some of it to begin with.

Any help would be appreciated.

Private Sub Command83_Click()
DoCmd.GoToRecord , , acNext
DoCmd.GoToRecord , , acPrevious

Dim stDocName As String
Dim strPath As String
Dim strTemp As String
Dim strBody As String
Dim strEmail As String
Dim EmailApp As Object
Dim NameSpace As Object
Dim EmailSend As Object


If Right(strEmail, 1) = ";" Then
strEmail = Left(strEmail, Len(strEmail) - 1)
End If

strPath = "c:\temp\feed.rtf"

DoCmd.OutputTo acReport, "feedback", acFormatRTF, strPath
Open strPath For Input As #1
Do Until EOF(1)
Line Input #1, strTemp
strBody = strBody & strTemp & vbCrLf
Loop
Close #1
Set EmailApp = CreateObject("Outlook.Application")
Set NameSpace = EmailApp.getNameSpace("MAPI")
Set EmailSend = EmailApp.CreateItem(0)

EmailSend.To = Forms!casesf!Arresting
EmailSend.subject = "FEEDBACK"
EmailSend.Display
EmailSend.Body = strBody

Set EmailApp = Nothing
Set NameSpace = Nothing
Set EmailSend = Nothing

Kill strPath

End Sub
 

Users who are viewing this thread

Back
Top Bottom