How can I read a Outlook .MSG file with VBScript?

From: news.microsoft.com (someone_at_microsoft.com)
Date: 10/26/04


Date: Tue, 26 Oct 2004 15:12:15 -0400

Hi all!

How can I read a .MSG file with vbscript? Ideally, I'd like to search for a
string in the text. The following code:

Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Documents and
Settings\itpes\Desktop\emails\RE account # 74919D.msg", ForReading)

Do Until objFile.AtEndOfStream
      Redim Preserve arrEmailLines(i)

 arrEmailLines(i) = objFile.ReadLine

 WScript.Echo "Line " & i & " " & arrEmailLines(i)

       WScript.Echo InStr( "http", arrEmailLines(i) )
 WScript.Echo "-------------------------------------------------"

 i = i + 1 'Increase the counter

Loop

'Close the file
objFile.Close

Won't find HTTP in the .MSG file... Any ideas will ge greatly appreicated.

Thanks

Paul



Relevant Pages

  • Re: multiple search and replaces in a text file
    ... My replace string is always the ... Const ForReading = 1 ... Set objFSO = CreateObject ... strNewText = objRE.Replace ...
    (microsoft.public.scripting.vbscript)
  • Re: Sending computer name to txt file if file didnt copy?
    ... Const ForReading = 1 ... Const OverwriteExisting = True ... Set objFSO = CreateObject ... 'Append text name and set path to remote location ...
    (microsoft.public.scripting.vbscript)
  • Re: Scripting amateur needs help modifying script
    ... Const ForReading = 1 ... Set objFSO = CreateObject ... split it up into an array, ... if there is a match at any point through the checking the iFound ...
    (microsoft.public.windows.server.scripting)
  • Re: VB scripting help
    ... Const ForReading = 1 ... Set objFSO = CreateObject ... For Each strComputer in arrComputers ...
    (microsoft.public.scripting.vbscript)
  • Re: script for count some char in a file
    ... i've created a script for count some type of characters into text file: ... Const ForReading = 1 ... Set objFSo = CreateObject ... But this script search all the first char on each line, ...
    (microsoft.public.scripting.vbscript)