Load MSG into PST

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?
 
D

Dmitry Streblechenko

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
-
 
M

MON205

1. How exactly did you call CreateItemFromTemplate?
pInboxFolder = m_spApp->GetNamespace( "MAPI" ).GetDefaultFolder(
Outlook::eek:lFolderInbox );
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
-------------------------------------------------
 
D

Dmitry Streblechenko

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
-
 
M

MON205

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.
 
Joined
Oct 23, 2023
Messages
17
Reaction score
0
If you want to load an MSG file into PST format, then you can use the SameTools Convert MSG to PST Software can help recover all data from MSG data to convert them into PST files This application can help to recover all emails, contacts with attachments, etc. data into PST format. MSG to PST converter software without losing the data of the file and without damaging the structure and layout of the file. Converter Software and This software also has several other interesting features for recovering data from MSG files. Use this application on all Windows operating systems.
Install: Load MSG to PST
 
Joined
Oct 26, 2023
Messages
20
Reaction score
0
Load MSG to PST with the help of ToolsBaer MSG to PST Conversion Tool with the help of this tool without technical errors. This application has simple graphic user interfaces so that users can convert MSG files into PST Outlook format, and the best part of this tool is that it supports all versions of Outlook 2021, 2019, 2016, 2013, 2010, 2007, and 2003, etc. files. Users can operate this tool on Windows 11, 10, 8.1, 8, 7, XP, and Vista operating systems.
 

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

Top