PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Parse .msg file

Reply

Parse .msg file

 
Thread Tools Rate Thread
Old 15-03-2006, 08:31 AM   #1
Vadivel
Guest
 
Posts: n/a
Default Parse .msg file


Hi All,

I have microsoft outlook .msg file in my local harddisk. i need to get
the from, to, subject values from that file.. is there any way to parse
the .msg file in java or
vb programs...

Thanks in Advance

Regards,
Vadivel

  Reply With Quote
Old 15-03-2006, 06:53 PM   #2
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: Parse .msg file

Or you can either use Extended MAPI (C++/Delphi, see
http://support.microsoft.com/?kbid=171907) or you can use Redemption (URL
below): RDOSession.GetMessageFromMsgFile, MAPIUtils.GetItemFromMsgFile,
RDOMail.Import, Safe*Item.Import and MessageItem.Import

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

"Vadivel" <kduraisamy@gmail.com> wrote in message
news:1142411491.095525.95920@p10g2000cwp.googlegroups.com...
> Hi All,
>
> I have microsoft outlook .msg file in my local harddisk. i need to get
> the from, to, subject values from that file.. is there any way to parse
> the .msg file in java or
> vb programs...
>
> Thanks in Advance
>
> Regards,
> Vadivel
>



  Reply With Quote
Old 15-03-2006, 06:59 PM   #3
=?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==
Guest
 
Posts: n/a
Default RE: Parse .msg file

Hhi Vadivel. Yes, you can. First, set a reference to the Microsoft Office
Outlook Object Model in the References dialog (depending on your programming
tool) or use late binding. The code is pretty simple:

Dim objApplication As Outlook.Application 'or "As Object" for late binding
'Note: if you are using the Outlook VBA Editor, you don't need to
explicitly declare
'an Outlook object variable; use the global Application object instead

Dim objMailItem As MailItem

Set objApplication = New Outlook.Application
Set objApplicatoin = CreateObject("Outlook.Application") 'for late binding

Set objMailItem =
objApplication.CreateItemFromTemplate("C:\Temp\test.msg")
Debug.Print objMailItem.Subject
Debug.Print objMailItem.To
'etc.

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Vadivel" wrote:

> Hi All,
>
> I have microsoft outlook .msg file in my local harddisk. i need to get
> the from, to, subject values from that file.. is there any way to parse
> the .msg file in java or
> vb programs...
>
> Thanks in Advance
>
> Regards,
> Vadivel
>
>

  Reply With Quote
Old 15-03-2006, 08:54 PM   #4
Dan Mitchell
Guest
 
Posts: n/a
Default RE: Parse .msg file

=?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==?=
<elegaultZZZ@REMOVEZZZmvps.org> wrote in
news:653BDF38-E76B-4F63-8556-761D9E06EC02@microsoft.com:
> Hhi Vadivel. Yes, you can. First, set a reference to the Microsoft
> Office Outlook Object Model in the References dialog (depending on
> your programming tool) or use late binding. The code is pretty
> simple:


Note that in Java this stuff is much easier if you're using Microsoft
J++, but I think that died as of the (now unavailable) DevStudio V6. I
could be wrong there.

Both this and Dmitry's suggestion assume that you have Outlook installed
on the PC in question -- if not, then it's worth knowing that a .msg file
is just a standard structured storage file, so you can use IStorage and
friends to pull it apart. If you use (say) DocFile viewer it's pretty
obvious what's going on for the basics like subject etc.

-- dan
  Reply With Quote
Old 16-03-2006, 09:43 AM   #5
Michael Bauer
Guest
 
Posts: n/a
Default Re: Parse .msg file

Am Wed, 15 Mar 2006 12:54:07 -0800 schrieb Dan Mitchell:

And if anyone doesn´t have the time to do the job on his own, I´ve found a
really great alternative: This site www.priasoft.com offers a library for
developers that can read msg files.

Just spend $25,000.00 (!) and you´re - sorry, it is done.


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


> =?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==?=
> <elegaultZZZ@REMOVEZZZmvps.org> wrote in
> news:653BDF38-E76B-4F63-8556-761D9E06EC02@microsoft.com:
>> Hhi Vadivel. Yes, you can. First, set a reference to the Microsoft
>> Office Outlook Object Model in the References dialog (depending on
>> your programming tool) or use late binding. The code is pretty
>> simple:

>
> Note that in Java this stuff is much easier if you're using Microsoft
> J++, but I think that died as of the (now unavailable) DevStudio V6. I
> could be wrong there.
>
> Both this and Dmitry's suggestion assume that you have Outlook installed
> on the PC in question -- if not, then it's worth knowing that a .msg file
> is just a standard structured storage file, so you can use IStorage and
> friends to pull it apart. If you use (say) DocFile viewer it's pretty
> obvious what's going on for the basics like subject etc.
>
> -- dan

  Reply With Quote
Old 16-03-2006, 06:17 PM   #6
Dan Mitchell
Guest
 
Posts: n/a
Default Re: Parse .msg file

Michael Bauer <mb@mvps.org> wrote in
news:dehkdzeeda5m$.15pjalom1evn4$.dlg@40tude.net:
> And if anyone doesn´t have the time to do the job on his own, I´ve
> found a really great alternative: This site www.priasoft.com offers a
> library for developers that can read msg files.
>
> Just spend $25,000.00 (!) and you´re - sorry, it is done.


http://www.priasoft.com/exchangemig...ducts_msg_r.asp for the
particular library. Very interesting -- thanks for the pointer, I'm always
surprised when I find out that people have done this sort of thing and
never posted about it to these groups..

-- dan
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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