Redemption - invisible message body

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
 
D

Dmitry Streblechenko \(MVP\)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top