On the Extended MAPI level, Sent/Unsent flag can only be set before the
message is saved for the very first time. The only Outlook item created in
the sent state is a post item; you can use that fact to fake a sent item:
see
http://www.dimastr.com/redemption/faq.htm#8 for an example.
<plug>
You can also do that using Redemption - no dirty workarounds; RDOMail.Sent
property is settable before the message is saved for the very first time.
Try something like the following:
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set NewMsg =
Session.GetDefaultFolder(olFolderSentMail).Items.Add("IPM.Note")
NewMsg.Sent = true
NewMsg.Subject = "fake sent item"
NewMsg.Body = "test body"
set Recip = NewMsg.Recipients.Add("(e-mail address removed)")
Recip.Resolve
NewMsg.Sender = Session.CurrentUser
NewMsg.SentOnBehalfOf = Session.CurrentUser
NewMsg.SentOn = Now
NewMsg.ReceivedTime = Now
NewMsg.Save
</plug>
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool