Question Parse Word Document Line by Line

mevasquez

New member
Joined
Jan 5, 2009
Messages
2
Programming Experience
Beginner
I have about 14,000 word documents that I need to parse looking for a date on a line. I can go through the directory where the files are located but how do I parse the document. Here is what I have so far:

VB.NET:
        Dim appWord As New Word.Application
        Dim docWord As New Word.Document
        Dim sPath As String = "C:\PathToDirectory"
        Dim sFilename As String

        Dim dir As New DirectoryInfo(sPath)

        For Each file As FileInfo In dir.GetFiles()
            sFilename = file.ToString

            docWord = appWord.Documents.Open(sPath & sFilename)
            docWord.Activate()

            'NEED TO PARSE  HERE

            docWord.Close()

        Next


The samples of the specific line are as follows. The date is the only thing consistant.
DATE OF EVALUATION: 13 APRIL 2010
DATE / TIME OF ARRIVAL: 11 DECEMBER 2009
DATE OF OPERATION: 12 March 2010

I need to get the date.
Does anyone have a sample?

TIA
Mike V
 
Back
Top