How to work with Redemption SafeMailItem and Outlook MailItem?

B

Bingo

' Outlook MailItem
' It has one recipient, someone
oMaipMailItem

' Redemption SafeMailItem
oRdpMailItem

oRdpMailItem.Item = oMaipMailItem
Set oRdpRecipients = oRdpMailItem.Recipients
' oRdpRecipients has zero count??
' but oMaipMailItem.Recipients has one count
' so the code I have to remove all recipients from
' oRdpRecipients never executed

Set oRdpRecipient = oRdpRecipients.Add("Bingo")
oMapiRecipient.Type = 1 'olTo

oMapiMailItem.Display
' oMapiMailItem still has the original recipient, someone

What are the right steps to do this? Thanks.
 
D

Dmitry Streblechenko \(MVP\)

Yes, you need to call Saveif you made changes using either Outlook Object
Model or the Outlook UI for the changes to be visible to Redemption (or
Extended MAPI for that matter). If you make a change using Redemption (or
Extended MAPI), you will need to completely dereference the Outlook object
(as well as Redemption Safe*Item if it refers to that Outlook item), then
reopen the item (e.g. using Namespace.GetItemFromID) if you want the chnages
to be visible in OOM or the Outlook UI.
In your particular case, only reading the To property is blocked, but not
setting it. Instead of using the Recipients collection, set the To property.

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

Top