Again: create item with Sent flag set

  • Thread starter Thread starter klemid
  • Start date Start date
K

klemid

I'm again/still struggling with creating a new custom (!) item in the
inbox with the 'sent' set w/o sending it actually. I followed Dmitry's
advice to create it as a IPM.Post and changed the message class
afterwards. After setting a bunch of other properties this worked to
far. But now I'm again at a point this workaround hurts. When I try to
modify controls on the form this fails because the attached
FormDescription still has the message class IPM.Post. Additionally,
when I open the form, the compose layout is shown. However it should be
the read layout. So, which additional properties do I need to set to
let this fully work. I played with CDO (which allows to set the Sent
flag) but some missing stuff in Redemption prevents me to convert this
CDO item back to a Redemption (I don't remember exactly what this was)
w/o a security warning.
- Klemens
 
By default messages do not have any customization. Where does
FormDescription come from? If you only modify the controls *after* the
mesage class is reset to IPM.Note and the message is reopened,
FormDescription cannot possibly remember that the message used to be
IPM.Post.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
I found another way: Create it directly as IPM.Note.MyForm and unset
the MSGFLAG_UNSENT flag in PR_MESSAGE_FLAGS.
- Klemens
 
SaveToContainer as Sent Message

I am trying to read logged emails from another system and create new messages to place into the Journaling mailbox on Exchange 2003. The only issue I am having is getting the MSGFLAG_UNSENT removed from the PR_MESSAGE_FLAGS MAPI property even though I set it to 3 in the script. My Archive system will not read the messages from the Journal mailbox unless the message has the MSGFLAG_UNSENT removed.


Const adModeReadWrite = 3
Const adCreateNonCollection = 0
Const adTypeText = 2

FolderUrl = "http://ExchServer/Exchange/MailBox/Inbox"
Set Conn = CreateObject("ADODB.Connection")
Conn.Provider = "MSDAIPP.DSO.1"
Conn.Open FolderUrl,strUserName,strPassword,0

Set Stm = CreateObject("ADODB.Stream")
Stm.Open
stm.Type = adTypeText
stm.Charset = "US-ASCII"
'Stm.LoadFromFile "FW_ This card.eml"
'trying to get the original received date into the message
stm.writeText "Received: ; Tue, 6 Mar 2007 23:27:24 -0600",1
stm.writeText "Date: Tue, 6 Mar 2007 23:27:24 -0600",1

Set iMsg = CreateObject("CDO.Message")
iMsg.datasource.openobject stm,"_Stream"
iMsg.MimeFormatted = True
iMsg.To = "(e-mail address removed)"
iMsg.From = "(e-mail address removed)"
iMsg.Subject= "Test Message"
iMsg.TextBody = "This is the message"

iMsg.Fields("<A href="http://schemas.microsoft.com/exchange/outlookmessageclass" ).Value?>http://schemas.microsoft.com/exchange/outlookmessageclass").Value = "IPM.Note.*"
iMsg.Fields("http://schemas.microsoft.com/mapi/proptag/x0E070003").value = 3
iMsg.Fields("urn:schemas:httpmail:read") = FALSE
iMsg.Fields.Update
http://schemas.microsoft.com/mapi/proptag/x0E070003

iMsg.DataSource.SaveToContainer FolderUrl,conn , adModeReadWrite, adCreateNonCollection

 
Back
Top