+ Reply to Thread
Results 1 to 2 of 2

Data Extraction with Excel VBA from .msg files

  1. #1
    Registered User
    Join Date
    01-12-2011
    Location
    Kolkata, India
    MS-Off Ver
    Office 2007
    Posts
    8

    Question Data Extraction with Excel VBA from .msg files

    Disclaimer: I am a beginner with VBA.

    I started off trying to create a VBA code that would extract certain text from a folder full of .msg files (Outlook 2007) and put them in a a blank workbook.

    After a lot of google it seemed to me that its impossible to get a text stream to parse from msg files. So I tried to save a few of the msg files as txt files and used the following code on it. It worked fine!

    Now the challenge is, I tried a code to batch rename the extension of the .msg files to .txt files. Just renaming the files (Not SaveAs txt) results in files with a lot of garbage headers in the file and the code doesn't work.

    Please help me with some code which would either:
    A> create a text stream directly from .msg files OR
    B> copy the legible section of the renamed files into a temporary txt file for parsing OR
    C> modify the code to work in spite of the garbage headers OR
    D> any other ideas to make this work that I didn't think of.

    Please check the attached zip files with all the working files.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-12-2011
    Location
    Kolkata, India
    MS-Off Ver
    Office 2007
    Posts
    8

    Re: Data Extraction with Excel VBA from .msg files

    BTW... If I have to use the renamed .txt files, then the garbage is before line 10 and after line 40. Can this code be modified to read only between line 10 & 40? That might work...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1