Hello Sue,
The actual code I'm using is the code I found at
http://www.outlookcode.com/d/formatmsg.htm#wordmail. I've downloaded a
dll from that website (mapirtf.dll) and placed it in my system32
directory. Here's all code I'm using. This code assumes you have already
a variable (cRTF) which contains some RTF-text. This code opens/shows a
new e-mail in RTF-Format. In that e-mail I just type a recipient and I
send the mail manually by clicking the outlook-button 'send and
receive'. In my send-items folder, the e-mail is displayed correctly in
RTF format, but the recipient just sees plain text.
Public Declare Function WriteRTF _
Lib "mapirtf.dll" _
Alias "writertf" (ByVal ProfileName As String, _
ByVal MessageID As String, _
ByVal StoreID As String, _
ByVal cText As String) _
As Integer
Public Declare Function ReadRTF _
Lib "mapirtf.dll" _
Alias "readrtf" (ByVal ProfileName As String, _
ByVal SrcMsgID As String, _
ByVal SrcStoreID As String, _
ByRef MsgRTF As String) _
As Integer
Public Sub SendEmail
Dim objSession, objMessage, objMessageFilter As Object
Dim MessageID, cRTF As String
Dim bRet As Integer
Set objSession = CreateObject("MAPI.Session")
objSession.Logon
' Read the first message in the Inbox
Set objMessage = objSession.Inbox.Messages(1)
objMessage.Update ' to get a permanent Entry ID
MessageID = objMessage.ID
' We must initialize the string variable we are passing
' to a string of the maximum length we want to read
cRTF = Space(500)
bRet = ReadRTF(objSession.Name, objMessage.ID, _
objMessage.StoreID, cRTF)
If Not bRet = 0 Then
MsgBox "RTF Not Written Successfully"
Else
MsgBox "RTF Text: " & Chr(13) & cRTF
End If
Set objMessage = Nothing
objSession.Logoff
Set objSession = Nothing
End Sub
*** Sent via Developersdex
http://www.developersdex.com ***