Re: 2 Problems with reading Msg-Files



Thanks, Dimitry,

When I open it by Misc | OpenIMsgOnIStg I can read properties and
attachments. This is not very surprising, because with OutlookSpy I need
Outlook and on the System with Outlook my own Testprogramm works very well.

Is it possible, to run OutlookSpy standalone only on ExchangeMapiCdo?

I suppose two things:
1) MSG-Files created (or converted) by Outlook 2003 can be read properly by
MAPI delivered by ExchangeMapiCdo 2.1.2

2) MSG-Files created by former version of Outook 2003 ((mayby, I dont no
which) can not be read poperly. Can I extract Outlook-Version from MSG-File?

"Dmitry Streblechenko" wrote:

1. Hmmmm... The error is MAPI_E_CALL_FAILED. Have you trid to look at thee
MSG files using OutlookSpy (click Misc | OpenIMsgOnIStg button on the
OutlookSpy toolbar).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"terac" <terac@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:20A6AE72-3ADE-4165-8162-A02D980D379B@xxxxxxxxxxxxxxxx
Hello Dimitry,

thanks for your answer.

1. HrGetOneProp returns 0x80004005, OpenProperty returns MAPI_E_NOT_FOUND

2. Sorry, my mistake. MAPI_MODIFY was the key. Now I can save
Attachements.

"Dmitry Streblechenko" wrote:

1. What error does HrGetOneProp return for these properties?
2. Why are you opening the attachment with the write access
(MAPI_MODIFY)?
How did you open the message?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"terac" <terac@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DFCEA701-CDB1-44CE-B1F8-580A878FBD76@xxxxxxxxxxxxxxxx
Hi all,

I want to read Msg-Files including separating Attachements.
On destination system there is no outlook available. The idea is
to use ExchangeMapiCdo distributed by MS.
The Msg-Files were created by different versions of Outlook/Exchange.
Further I want to implement in Delphi (but this is no must).
I use MapiHeaders from Dimitry Streblechenko (Thanks Dimitry)

Problem #1
----------
Case 1a) ExchangeMapiCdo (XP SP2 or W2K SP4)
Some Msg-Files I cannot read with ExchangeMapiCdo, espechially
PR_SUBJECT
PR_RECEIVED_BY_NAME
PR_RECEIVED_BY_EMAIL_ADDRESS
PR_SENT_REPRESENTING_NAME
PR_RCVD_REPRESENTING_NAME
PR_BODY

Neither I can't read these by HrGetOneProp nor by OpenProperty.
Im wondering, because PR_RTF_COMPRESSED I can read by OpenProperty
and WrapCompressedRTFStream.

If I Open the Msg-File with Outlook 2003 at an second system, an Save
it
as
new
Msg-File, I can read all of the above mentioned properties at the first
system.

Case 1b) Outlook 2003 (XP SP2)
All of the above mentioned properties I can read by the test program.

Problem #2
----------
I cannot retrieve Attachement from a Msg-File.
Occurs at all my systems (with Outlook and without Outlook only with
ExchangeMapiCdo)

OpenAttach(ATT_NUM, IMAPIProp, MAPI_BEST_ACCESS, lppAttach);
lppAttach.OpenProperty(PR_ATTACH_DATA_BIN, IStream, 0, MAPI_MODIFY,
IUnknown(Stream) );

OpenProperty returns MAPI_E_NO_ACCESS.

But long filename I can get.
Prop.OpenProperty(PR_ATTACH_LONG_FILENAME, IStream, STGM_READ, 0,
IUnknown(Stream) );
This seems very strange to me.

Then I checked these with OutlookSpy. The behaviar is similar:
Open the Msg-File, IMessage, Attachmenttable, OpenAttach fails with
MAPI_E_NO_ACCESS.
But if I Copy the Msg-File into my PST-Folder, then OutoolSpy can open
the
PR_ATTACH_DATA_BIN
stream.

Does anybody give me some hints?

Thanks, Falk.






.