Redemption - invisible message body

  • Thread starter Thread starter Joe Black
  • Start date Start date
J

Joe Black

Dmitry Streblechenko (MVP) said:
As Ken said, Outlook does not block writing to the Body and HTMLBody
properties, so even if you use Redemption to set them, the call will still
go to the Outlook Object Model. If you look at the message in the Sent Items
using MdbView or OutlookSpy, can you see PR_BODY and PR_RTF_COMPRESSED?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Hi Dmitry

I don't have MdbView and my evaluation copy of OutlookSpy has expired
(sorry - can't afford to buy it).

I changed my code a bit and now explicitly set the MailItem.BodyFormat to 2
(html). When I open the sent message, the body is blank and in the title bar
it says the message subject and then says "(Plain Text)". Using Outlook
2002.

What difference would PR_BODY and PR_RTF_COMPRESSED make?

Regards - Joe

'*************
Set objOutlook = GetObject("", "Outlook.Application")

Set objOutlookMAPI = objOutlook.GetNamespace("MAPI")
Set objOutlookMsg = objOutlook.CreateItem(0)

With objOutlookMsg
If Not IsMissing(MsgSubject) Then .Subject = MsgSubject

If Not IsMissing(HTMLBodyText) Then
If Len(Trim(HTMLBodyText)) > 0 Then
.BodyFormat = 2
.HTMLBody = HTMLBodyText
End If
End If

If Not IsMissing(AttachmentPath) Then
If Len(Trim(AttachmentPath)) > 0 Then .Attachments.Add
AttachmentPath
End If

'Redemption
Dim SafeItem
Set SafeItem = CreateObject("Redemption.SafeMailItem")
SafeItem.Item = objOutlookMsg

With SafeItem
Set objOutlookRecip = .Recipients.Add(strAddress)
objOutlookRecip.Type = 1

If DisplayMsg Then
.Display
Else
.Send
End If
End With
 
Hmmm... I don't know. What if you sprinkle your code with
MsgBox(objOutlookMsg.Body) to see where the body gets reset?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top