Re: Outlook MailItem Read-only

  • Thread starter Dmitry Streblechenko
  • Start date
D

Dmitry Streblechenko

It is the same MailItem, but its Sent property is true. Generally, you
cannot create new messages in the sent state in OOM (Sent property is
read-only). The workaround is to create a PostItem (which is created in the
sent state), then change its message class to IPM.Note:

set Msg = Application.CreateItem(olPostItem)
Msg.Body = "body"
Msg.Subject = "subject"
Msg.MessageClass = "IPM.Note"
Msg.Save
EntryID = Msg.EntryID
set Msg = Nothing
set Msg = Application.Session.GetItemFromID(EntryID)
Msg.Display


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
A

Avi

Thanks Dmitry for the reply.
A couple of questions though:
1)I have a saved e-mail in a database, and I would like to
open it using outlook in a 'sent' state as u mentioned.
Your method saves it to outlook too, which I would like to
avoid.
2)Also, I saved it from postItem to mailItem and it worked
also.
3)Also in both instances, I can edit the subject.
Thanks,
Avi
 
D

Dmitry Streblechenko

1. You can create MSG files, but it can only done using Extended MAPI
(C++/Delphi)
3. There is really no way to change that.

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

Similar Threads


Top