A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Load MSG into PST



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 20th 08, 03:48 PM posted to microsoft.public.outlook.program_addins
MON205[_2_]
external usenet poster
 
Posts: 33
Default Load MSG into PST

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
  #2  
Old July 20th 08, 05: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?



  #3  
Old July 21st 08, 08:53 AM posted to microsoft.public.outlook.program_addins
MON205[_2_]
external usenet poster
 
Posts: 33
Default Load MSG into PST

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

"Dmitry Streblechenko" wrote:

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?




  #4  
Old July 21st 08, 07:26 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Load MSG into PST

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
-
"MON205" wrote in message
...
1. How exactly did you call CreateItemFromTemplate?
pInboxFolder = m_spApp-GetNamespace( "MAPI" ).GetDefaultFolder(
Outlook: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
-------------------------------------------------

"Dmitry Streblechenko" wrote:

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?






  #5  
Old July 22nd 08, 07:56 AM posted to microsoft.public.outlook.program_addins
MON205[_2_]
external usenet poster
 
Posts: 33
Default Load MSG into PST

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.

"Dmitry Streblechenko" wrote:

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
-
"MON205" wrote in message
...
1. How exactly did you call CreateItemFromTemplate?
pInboxFolder = m_spApp-GetNamespace( "MAPI" ).GetDefaultFolder(
Outlook: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
-------------------------------------------------

"Dmitry Streblechenko" wrote:

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?






 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I load WebDAV? oldman Outlook - Calandaring 2 July 1st 08 02:13 PM
load Dll Lisandro Oliveira Outlook and VBA 2 February 21st 07 04:55 PM
Failure of OE6 to load epd Outlook Express 1 August 7th 06 02:10 PM
COM Add in won't load other than with IDE on WS2003/XP [email protected] Outlook and VBA 2 April 12th 06 06:56 PM
Load once Dave C Outlook - Installation 2 January 24th 06 06:42 PM


All times are GMT +1. The time now is 09:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.