View Single Post
  #2  
Old July 20th 08, 06:24 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Load MSG into PST

How exactly did you call CreateItemFromTemplate?
RDOMail.Sent can be set only before the message is saved for the very first
time, otherwise you will get the MAPI_E_COMPUTED error.
If oyu are using Redemption, why do you even need
Namespace.CreateItemFromTemplate?
Something like the following will do the trick:

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Folder = Session.GetDefaultFolder(...)
set Msg = Folder.Items.Add
Msg.Sent = true
Msg.Import(..., olMsg)
Msg.Save

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"MON205" wrote in message
...
Hello,
I want to load a stand alone MSG file (on disk) into Outlook. To do this,
I
tried using the CreateItemFromTemplate() function. This always return
"invalid argument" when trying to pass a folder as the second argument. To
go
over this, I tried ignoring the second parameter. Now, the MSG loaded into
the DRAFTS folder. Another time, I went over this by moving the mail to
the
Inbox. Also, the Message Dates changed (creation / Delivery). These dates
can
be updated.
The problem now that the MSG appaers as "not sent". I tried setting the
(0xF402) property using OutlookSPY, but that didn't change anything. Also
Redemption.RDOMail.put_Sent() returned "0x8004011a"!!!!!
Any help?



Ads