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 » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Parse .msg file



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 15th 06, 09:31 AM posted to microsoft.public.outlook.program_vba
Vadivel
external usenet poster
 
Posts: 7
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

  #2  
Old March 15th 06, 07:53 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default 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" wrote in message
ups.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



  #3  
Old March 15th 06, 07:59 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default 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\tes t.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


  #4  
Old March 15th 06, 09:54 PM posted to microsoft.public.outlook.program_vba
Dan Mitchell
external usenet poster
 
Posts: 58
Default Parse .msg file

=?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==?=
wrote in
:
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
  #5  
Old March 16th 06, 10:43 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default 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==?=
wrote in
:
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

  #6  
Old March 16th 06, 07:17 PM posted to microsoft.public.outlook.program_vba
Dan Mitchell
external usenet poster
 
Posts: 58
Default Parse .msg file

Michael Bauer wrote in
:
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/exchangemigr...ucts_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
 




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
Parse .msg file Vadivel Outlook - Using Forms 1 March 15th 06 05:26 PM
Custom Form saved as *.msg file not opening correctly in Outlook 2 Jim S. Outlook - Using Forms 5 March 6th 06 05:35 PM
outgoing msg Bill H. Outlook Express 5 February 22nd 06 06:51 PM
how to resend a msg Hasan Outlook - General Queries 3 February 18th 06 08:11 PM
How to open .msg outlook file in IE MSDN Outlook - General Queries 2 February 8th 06 09:38 PM


All times are GMT +1. The time now is 11:31 PM.


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