Outlook redemption saveas generating security warning

D

dkgb

I am trying to use Outlook Redemption to save an email message upon arrival
to a msg file. Despite using redemption, it generates a security message.
Am I doing something wrong? See code below.


strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
on Error GoTo exitfunction
Set olMail = olNS.GetItemFromID(strID)
On Error GoTo 0
Set SafeMail = CreateObject("Redemption.SafemailItem")
SafeMail.item = olMail

StrPath = StrPath & "Suppliers\" & ID & "-" & Format(rstlog!ID, "#") & ".msg"
SafeMail.item.SaveAs StrPath, olMSG
 
D

Dmitry Streblechenko

Change the line
SafeMail.item.SaveAs StrPath, olMSG
to
SafeMail.SaveAs StrPath, olMSG

Why do you reopen the item using GetItemFromID?

Set SafeMail = CreateObject("Redemption.SafemailItem")
SafeMail.item = MyMail
StrPath = StrPath & "Suppliers\" & ID & "-" & Format(rstlog!ID, "#") &
".msg"
SafeMail.SaveAs StrPath, olMSG

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