Load MSG into PST

  • Thread starter Thread starter MON205
  • Start date Start date
M

MON205

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?
 
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
-
 
1. How exactly did you call CreateItemFromTemplate?
pInboxFolder = m_spApp->GetNamespace( "MAPI" ).GetDefaultFolder(
Outlook::olFolderInbox );
MSG = m_spApp->CreateItemFromTemplate( TEXT( "f:\\test.msg" ), _variant_t(
pInboxFolder ) );
// Here a E_INVALIDARG exception raise

2. Importing using Redemption succeeded. I noticed that the dates are the
same as the original message, is there any property that I should set
manually as the "Sent"?

3. I think that the Redemption is a great library, but I think that it needs
more work on the documentation.

Thanks Dmitry
-------------------------------------------------
 
1. How did you declare pInboxFolder?
2. No, unless you want to overwrite whatever teh MSG file has or if you want
to add a property not in teh MSG file.
3. That's what the newsgroups are for :-)

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
Now it is 1-0 for you :)
About the "pInboxFolder", GetDefaultFolder() returns a smart pointer
"MAPIFolderPtr" when passin this smart pointer, the exception raised. Also I
tried passing "pInbox.GetInterfacePtr( )" to pass the interface, the function
succeeded but the message added to the Drafts folder.
 
You can try the TrustVare MSG to PST Converter Tool to load MSG into PST without Outlook I am suggesting this tool with my personal experience I tried this tool recently without any technical error and here you don't need professional technical knowledge. You can work with all versions of MS Outlook without restrictions. You can install this tool on Windows OS.
 
I have one of the best software that will help to load MSG to PST with attachment without MS Outlook and any installation of a third application for conversion of MSG to PST without installing MS Outlook should try the WholeClear MSG to PST Converter Tool it has a simple graphic user interface that helps to convert MSG emails in bulk at once into PST format and will not create any technical errors. Users can connect to work with any latest and previous versions of MS Outlook files. This application can be installed on Windows with a free trial version and load a few MSG into PST.
 
Back
Top