PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Redemption - invisible message body
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Redemption - invisible message body
![]() |
Redemption - invisible message body |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
"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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

