Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: How to store new message item in Sent folder

Geek News

How to store new message item in Sent folder
Ivan 6/1/2007 4:53:03 AM
When I create new message item and move it to 'Sent' folder this message has
'message was not sent' flag. I'd like to see this message as if it was
usually sent, but I don't wnat to send it using Outlook.
Is it possible?
Re: How to store new message item in Sent folder
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 6/1/2007 1:21:14 PM
Not really. Not unless you create it with Extended MAPI or a wrapper for
MAPI. Even then you can only set some of the properties, others you will
never be able to get so the item really looks like it was sent.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ivan" <Ivan[ at ]discussions.microsoft.com> wrote in message
news:C9958333-B806-4737-B056-9E322C7DB80D[ at ]microsoft.com...
[Quoted Text]
> When I create new message item and move it to 'Sent' folder this message
> has
> 'message was not sent' flag. I'd like to see this message as if it was
> usually sent, but I don't wnat to send it using Outlook.
> Is it possible?

Re: How to store new message item in Sent folder
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 6/1/2007 5:58:44 PM
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("user[ at ]example.com")
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

"Ivan" <Ivan[ at ]discussions.microsoft.com> wrote in message
news:C9958333-B806-4737-B056-9E322C7DB80D[ at ]microsoft.com...
[Quoted Text]
> When I create new message item and move it to 'Sent' folder this message
> has
> 'message was not sent' flag. I'd like to see this message as if it was
> usually sent, but I don't wnat to send it using Outlook.
> Is it possible?


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net