Re: 2 Problems with reading Msg-Files



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.


.



Relevant Pages

  • Re: 2 Problems with reading Msg-Files
    ... HrGetOneProp returns 0x80004005, OpenProperty returns MAPI_E_NOT_FOUND ... I want to read Msg-Files including separating Attachements. ... On destination system there is no outlook available. ... If I Open the Msg-File with Outlook 2003 at an second system, ...
    (microsoft.public.win32.programmer.messaging)
  • Re: 2 Problems with reading Msg-Files
    ... First I have installed Outlook 2000 on a clean W2K SP4 System. ... "Dmitry Streblechenko" wrote: ... I want to read Msg-Files including separating Attachements. ... If I Open the Msg-File with Outlook 2003 at an second system, ...
    (microsoft.public.win32.programmer.messaging)
  • Viewer for MS Outlook .msg-files
    ... MSGView can read/extract the any information from msg-file created in MS ... You may read the message with all mail information (subject, body, ... If you have not the installed MS Outlook, ... extract all attachments from mail and save with original file. ...
    (comp.software.shareware.announce)
  • Viewer for MS Outlook .msg-files
    ... MSGView can read/extract the any information from msg-file created in MS ... You may read the message with all mail information (subject, body, ... If you have not the installed MS Outlook, ... extract all attachments from mail and save with original file. ...
    (comp.software.shareware.announce)
  • Re: Outlook 2002 Plugin with Extended Mapi API
    ... "mike" wrote in message ... > Outlook plugin written in VB6. ... > "Bad DLL calling convention error" on the hrGetOneProp call. ... > Dim ptrSProp As Long ...
    (microsoft.public.outlook.program_addins)