VB.NET read msg file

Posted on 2010-01-03
Last Modified: 2012-05-08
I have an application that requires to read the contents of outlook MSG files and read\obtain the contents of the email.  Can you please suggest the best method for opening and reading MSG files.
Question by:Cmitch
    LVL 59

    Accepted Solution

    Hello Cmitch,

    Using VBA you would for example:

    Dim mai As mailitem
        Set mai = Application.CreateItemFromTemplate("c:\users\wobble\fred.msg")

    I presume the interface will be similar and after running the code 'mai' is a mailitem that can be treated normally.


    LVL 69

    Expert Comment

    by:Éric Moreau

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Create high volume marketing opportunities using email signatures with these top 10 DOs and DON'Ts of email signature marketing.
    Set OWA language and time zone in Exchange for individuals, all users or per database.
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now