PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Redemption - invisible message body

Reply

Redemption - invisible message body

 
Thread Tools Rate Thread
Old 30-04-2004, 03:35 AM   #1
Joe Black
Guest
 
Posts: n/a
Default Redemption - invisible message body


"Dmitry Streblechenko (MVP)" <dmitry@dimastr.com> wrote in message
news:uDHt6svJEHA.3216@tk2msftngp13.phx.gbl...
> 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


  Reply With Quote
Old 01-05-2004, 09:12 AM   #2
Dmitry Streblechenko \(MVP\)
Guest
 
Posts: n/a
Default Re: Redemption - invisible message body

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


"Joe Black" <joeblack99@hotmail.com> wrote in message
news:XXikc.6$8J.516@news.xtra.co.nz...
> "Dmitry Streblechenko (MVP)" <dmitry@dimastr.com> wrote in message
> news:uDHt6svJEHA.3216@tk2msftngp13.phx.gbl...
> > 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
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off