Reading outlook .msg files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sueffel

    #16
    Re: Reading outlook .msg files


    "Sueffel" <someone@somewh ere.com> wrote in message
    news:uRI%23baX9 DHA.1424@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > And actually, I posted before I thought bout it more, email messages[/color]
    are[color=blue]
    > required to be plain-text unless they are encrypted. If they are[/color]
    encrypted[color=blue]
    > by Outlook for whatever reason, you're pretty hosed. Ofcourse, not 100%
    > sure what Outlook may be doing to this file, but it sure is really[/color]
    fubared,[color=blue]
    > and needs to be avoided LOL
    > It looks to be a non-stander, IE fubared, db type of format, let me[/color]
    see[color=blue]
    > what I can dig up for ya...
    >
    > Sueffel
    >
    >
    >
    > ---
    > Outgoing mail is certified Virus Free.
    > Checked by AVG anti-virus system (http://www.grisoft.com).
    > Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004
    >
    >[/color]

    Well damn,MS strikes again with propritary format! I've seen .msg files
    many time on linux email servers, but it seems that this is something MS has
    tried to say, "Hey, this is ours and there's nothing you can do about it".
    That sucks, I will look somemore thoguh unless those links jay giave are the
    answer.

    Sueffel


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004


    Comment

    • Graham F French

      #17
      Re: Reading outlook .msg files

      Hi,

      I have yet to find some info on this, anything you can get would be
      appreciated!

      Thanks

      Graham

      "Sueffel" <someone@somewh ere.com> wrote in message
      news:%237x5eFY9 DHA.4044@tk2msf tngp13.phx.gbl. ..[color=blue]
      >
      > "Sueffel" <someone@somewh ere.com> wrote in message
      > news:uRI%23baX9 DHA.1424@TK2MSF TNGP12.phx.gbl. ..[color=green]
      > > And actually, I posted before I thought bout it more, email messages[/color]
      > are[color=green]
      > > required to be plain-text unless they are encrypted. If they are[/color]
      > encrypted[color=green]
      > > by Outlook for whatever reason, you're pretty hosed. Ofcourse, not 100%
      > > sure what Outlook may be doing to this file, but it sure is really[/color]
      > fubared,[color=green]
      > > and needs to be avoided LOL
      > > It looks to be a non-stander, IE fubared, db type of format, let me[/color]
      > see[color=green]
      > > what I can dig up for ya...
      > >
      > > Sueffel
      > >
      > >
      > >
      > > ---
      > > Outgoing mail is certified Virus Free.
      > > Checked by AVG anti-virus system (http://www.grisoft.com).
      > > Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004
      > >
      > >[/color]
      >
      > Well damn,MS strikes again with propritary format! I've seen .msg files
      > many time on linux email servers, but it seems that this is something MS[/color]
      has[color=blue]
      > tried to say, "Hey, this is ours and there's nothing you can do about it".
      > That sucks, I will look somemore thoguh unless those links jay giave are[/color]
      the[color=blue]
      > answer.
      >
      > Sueffel
      >
      >
      > ---
      > Outgoing mail is certified Virus Free.
      > Checked by AVG anti-virus system (http://www.grisoft.com).
      > Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004
      >
      >[/color]


      Comment

      • Jay B. Harlow [MVP - Outlook]

        #18
        Re: Reading outlook .msg files

        Graham,[color=blue]
        > Sorry, I do need to know how to read this file format directly into my
        > application.[/color]
        I'm Sorry, which part of "not documented" do you not understand? :-|
        [color=blue]
        > I know that it can be done in VB6.[/color]

        If you know how to do it in VB6, then you *should* know how to do it in
        VB.NET.

        Can you post the VB6 code you are using? The code should largely translate
        into VB.NET, nothing else, create a simple VB6 project that uses the code,
        then use the Upgrade Wizard in VB.NET to open the project.

        Hope this helps
        Jay

        "Graham F French" <graham.french@ satosoft.com> wrote in message
        news:uDpO7MW9DH A.712@tk2msftng p13.phx.gbl...[color=blue]
        > Jay,
        >
        > Sorry, I do need to know how to read this file format directly into my
        > application.
        >
        > I know that it can be done in VB6.
        >
        > Cheers
        >
        > Graham
        >
        > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @msn.com> wrote in message
        > news:uW6oN5V9DH A.3380@tk2msftn gp13.phx.gbl...[color=green]
        > > Graham,
        > > The .msg format is not documented.
        > >
        > > The "easiest" way to read it would be to have the App that defines the
        > > format read it, in this case Outlook.
        > >
        > > The following site provides a plethora of information on using Outlook[/color]
        > from[color=green]
        > > .NET.
        > >
        > > http://www.microeye.com/resources/res_outlookvsnet.htm
        > >
        > > Hope this helps
        > > Jay
        > >
        > > "Graham F French" <graham.french@ satosoft.com> wrote in message
        > > news:%23F9VLTU9 DHA.2064@TK2MSF TNGP11.phx.gbl. ..[color=darkred]
        > > > Hello,
        > > >
        > > > I can read text files into my application, but I cannot read in msg[/color][/color]
        > files[color=green]
        > > as[color=darkred]
        > > > they seem to be in a proprietry format.
        > > >
        > > > Is there anyway of converting it on the fly or is there an[/color][/color]
        > interpretation[color=green][color=darkred]
        > > > method?
        > > >
        > > > Thanks
        > > >
        > > > Graham
        > > >
        > > > Graham F French mcse
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Graham F French

          #19
          Re: Reading outlook .msg files

          Hi Jay,

          I don't know vb6 at all. It sounds strange, but I stared off with vbscript!
          Then I moved to asp.net.

          I could post the vb6 code that reads the file in, as it doesn't make much
          sense to me.

          Regards

          Graham
          "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @msn.com> wrote in message
          news:er733db9DH A.2460@TK2MSFTN GP09.phx.gbl...[color=blue]
          > Graham,[color=green]
          > > Sorry, I do need to know how to read this file format directly into my
          > > application.[/color]
          > I'm Sorry, which part of "not documented" do you not understand? :-|
          >[color=green]
          > > I know that it can be done in VB6.[/color]
          >
          > If you know how to do it in VB6, then you *should* know how to do it in
          > VB.NET.
          >
          > Can you post the VB6 code you are using? The code should largely translate
          > into VB.NET, nothing else, create a simple VB6 project that uses the code,
          > then use the Upgrade Wizard in VB.NET to open the project.
          >
          > Hope this helps
          > Jay
          >
          > "Graham F French" <graham.french@ satosoft.com> wrote in message
          > news:uDpO7MW9DH A.712@tk2msftng p13.phx.gbl...[color=green]
          > > Jay,
          > >
          > > Sorry, I do need to know how to read this file format directly into my
          > > application.
          > >
          > > I know that it can be done in VB6.
          > >
          > > Cheers
          > >
          > > Graham
          > >
          > > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @msn.com> wrote in[/color][/color]
          message[color=blue][color=green]
          > > news:uW6oN5V9DH A.3380@tk2msftn gp13.phx.gbl...[color=darkred]
          > > > Graham,
          > > > The .msg format is not documented.
          > > >
          > > > The "easiest" way to read it would be to have the App that defines the
          > > > format read it, in this case Outlook.
          > > >
          > > > The following site provides a plethora of information on using Outlook[/color]
          > > from[color=darkred]
          > > > .NET.
          > > >
          > > > http://www.microeye.com/resources/res_outlookvsnet.htm
          > > >
          > > > Hope this helps
          > > > Jay
          > > >
          > > > "Graham F French" <graham.french@ satosoft.com> wrote in message
          > > > news:%23F9VLTU9 DHA.2064@TK2MSF TNGP11.phx.gbl. ..
          > > > > Hello,
          > > > >
          > > > > I can read text files into my application, but I cannot read in msg[/color]
          > > files[color=darkred]
          > > > as
          > > > > they seem to be in a proprietry format.
          > > > >
          > > > > Is there anyway of converting it on the fly or is there an[/color]
          > > interpretation[color=darkred]
          > > > > method?
          > > > >
          > > > > Thanks
          > > > >
          > > > > Graham
          > > > >
          > > > > Graham F French mcse
          > > > >
          > > > >
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Eduardo A. Morcillo [MS MVP VB]

            #20
            Re: Reading outlook .msg files

            Outlook uses the OLE structured storage file format to write the .msg files.
            To read these files you have to use the OLE api. There's a set of VB.NET
            classes that wraps this API in my site:

            Once you download the classes you can use this code to read the message
            body:

            ' Open the message file
            Dim msg As New Storage("test.m sg")

            ' Get the message body stream
            Dim stream As OleStorage.Stre am = msg.OpenStream( "__substg1.0_80 050102")
            Dim reader As New IO.StreamReader (stream)

            ' Show the message body
            MsgBox(reader.R eadToEnd)

            ' Close the stream
            reader.Close()
            stream.Close()

            ' Close the message file
            msg.Close()

            The following are the streams I know:

            __substg1.0_003 7001E -> subject
            __substg1.0_005 0001E -> sender's email
            __substg1.0_065 0001E -> sender's email
            __substg1.0_076 0001E -> recipient's email
            __substg1.0_07D 0001E -> headers
            __substg1.0_0C1 F001E -> sender's email
            __substg1.0_100 0001E -> message body
            __substg1.0_103 5001E -> message id
            __substg1.0_104 6001E -> sender's email
            __substg1.0_800 50102 -> message body

            --
            Eduardo A. Morcillo [MS MVP VB]



            Comment

            • CJ Taylor

              #21
              Re: Reading outlook .msg files


              "Graham F French" <graham.french@ satosoft.com> wrote in message
              news:e5xaAib9DH A.452@TK2MSFTNG P11.phx.gbl...[color=blue]
              > Hi Jay,
              >
              > I don't know vb6 at all. It sounds strange, but I stared off with[/color]
              vbscript![color=blue]
              > Then I moved to asp.net.
              >[/color]

              If you know VBScript, Vb6 wouldn't be a challenge, since vbscript could be
              considered a subset of VB6...
              [color=blue]
              > I could post the vb6 code that reads the file in, as it doesn't make much
              > sense to me.
              >[/color]

              suspicious...
              [color=blue]
              > Regards
              >
              > Graham
              > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @msn.com> wrote in message
              > news:er733db9DH A.2460@TK2MSFTN GP09.phx.gbl...[color=green]
              > > Graham,[color=darkred]
              > > > Sorry, I do need to know how to read this file format directly into my
              > > > application.[/color]
              > > I'm Sorry, which part of "not documented" do you not understand? :-|
              > >[color=darkred]
              > > > I know that it can be done in VB6.[/color]
              > >
              > > If you know how to do it in VB6, then you *should* know how to do it in
              > > VB.NET.
              > >
              > > Can you post the VB6 code you are using? The code should largely[/color][/color]
              translate[color=blue][color=green]
              > > into VB.NET, nothing else, create a simple VB6 project that uses the[/color][/color]
              code,[color=blue][color=green]
              > > then use the Upgrade Wizard in VB.NET to open the project.
              > >
              > > Hope this helps
              > > Jay
              > >
              > > "Graham F French" <graham.french@ satosoft.com> wrote in message
              > > news:uDpO7MW9DH A.712@tk2msftng p13.phx.gbl...[color=darkred]
              > > > Jay,
              > > >
              > > > Sorry, I do need to know how to read this file format directly into my
              > > > application.
              > > >
              > > > I know that it can be done in VB6.
              > > >
              > > > Cheers
              > > >
              > > > Graham
              > > >
              > > > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP @msn.com> wrote in[/color][/color]
              > message[color=green][color=darkred]
              > > > news:uW6oN5V9DH A.3380@tk2msftn gp13.phx.gbl...
              > > > > Graham,
              > > > > The .msg format is not documented.
              > > > >
              > > > > The "easiest" way to read it would be to have the App that defines[/color][/color][/color]
              the[color=blue][color=green][color=darkred]
              > > > > format read it, in this case Outlook.
              > > > >
              > > > > The following site provides a plethora of information on using[/color][/color][/color]
              Outlook[color=blue][color=green][color=darkred]
              > > > from
              > > > > .NET.
              > > > >
              > > > > http://www.microeye.com/resources/res_outlookvsnet.htm
              > > > >
              > > > > Hope this helps
              > > > > Jay
              > > > >
              > > > > "Graham F French" <graham.french@ satosoft.com> wrote in message
              > > > > news:%23F9VLTU9 DHA.2064@TK2MSF TNGP11.phx.gbl. ..
              > > > > > Hello,
              > > > > >
              > > > > > I can read text files into my application, but I cannot read in[/color][/color][/color]
              msg[color=blue][color=green][color=darkred]
              > > > files
              > > > > as
              > > > > > they seem to be in a proprietry format.
              > > > > >
              > > > > > Is there anyway of converting it on the fly or is there an
              > > > interpretation
              > > > > > method?
              > > > > >
              > > > > > Thanks
              > > > > >
              > > > > > Graham
              > > > > >
              > > > > > Graham F French mcse
              > > > > >
              > > > > >
              > > > >
              > > > >
              > > >
              > > >[/color]
              > >
              > >[/color]
              >
              >[/color]


              Comment

              • Jay B. Harlow [MVP - Outlook]

                #22
                Re: Reading outlook .msg files

                Eduardo,
                Based on the numbers you are showing, it appears that each MAPI Property is
                stored as a separate Stream. Interesting!


                [color=blue]
                > __substg1.0_003 7001E -> subject[/color]


                Of course the .msg format itself is not not documented by MS that I know of,
                it may change use at your own risk. For example, the introduction of Unicode
                and Contact items and such...

                Thanks for the info!

                Hope this helps
                Jay



                "Eduardo A. Morcillo [MS MVP VB]" <emorcillo_at_m vps.org> wrote in message
                news:O0E2hVe9DH A.2760@TK2MSFTN GP09.phx.gbl...[color=blue]
                > Outlook uses the OLE structured storage file format to write the .msg[/color]
                files.[color=blue]
                > To read these files you have to use the OLE api. There's a set of VB.NET
                > classes that wraps this API in my site:
                >
                > Once you download the classes you can use this code to read the message
                > body:
                >
                > ' Open the message file
                > Dim msg As New Storage("test.m sg")
                >
                > ' Get the message body stream
                > Dim stream As OleStorage.Stre am = msg.OpenStream( "__substg1.0_80 050102")
                > Dim reader As New IO.StreamReader (stream)
                >
                > ' Show the message body
                > MsgBox(reader.R eadToEnd)
                >
                > ' Close the stream
                > reader.Close()
                > stream.Close()
                >
                > ' Close the message file
                > msg.Close()
                >
                > The following are the streams I know:
                >
                > __substg1.0_003 7001E -> subject
                > __substg1.0_005 0001E -> sender's email
                > __substg1.0_065 0001E -> sender's email
                > __substg1.0_076 0001E -> recipient's email
                > __substg1.0_07D 0001E -> headers
                > __substg1.0_0C1 F001E -> sender's email
                > __substg1.0_100 0001E -> message body
                > __substg1.0_103 5001E -> message id
                > __substg1.0_104 6001E -> sender's email
                > __substg1.0_800 50102 -> message body
                >
                > --
                > Eduardo A. Morcillo [MS MVP VB]
                > http://www.mvps.org/emorcillo
                >
                >[/color]


                Comment

                • Eduardo A. Morcillo [MS MVP VB]

                  #23
                  Re: Reading outlook .msg files

                  > Based on the numbers you are showing, it appears that each MAPI[color=blue]
                  > Property is stored as a separate Stream. Interesting![/color]

                  You are right, and that makes it easier.

                  --
                  Eduardo A. Morcillo [MS MVP VB]



                  Comment

                  • MSG.Expert
                    New Member
                    • Apr 2006
                    • 2

                    #24
                    MSG Files:

                    Priasoft has several MSG related products. http://www.priasoft.com

                    In particular, they have a MSG file parsing library that gives developers access to all the properties of a .msg file, without outlook.

                    They also have an export library that works with the MSG library for exporting msg files to other formats, like PDF, TIF, and HTML.

                    For PST files, they have a couple of command line tools that allow extraction of messages to MSG, again without requiring outlook, and it supports both ANSI and UNICODE pst files. There is also the reverse, a MSG to PST utility.

                    They also have a viewer product that looks very similar to outlook 2003 with regards to the User Interface. The viewer can view, search, print, and export msg files.

                    Lastly, they just release a free ViewOnly viewer here: http://www.priasoft.com/msgview.exe


                    Regards,
                    the MSG Guru, Eriq VanBibber

                    Comment

                    Working...