Searching a Word Document and listing values in Excel
<p>Alright, 
I've been cobbling together code to automate a task.  I have a word document that has something like 300 lines that each have an identifier number, a title, and a website.  I would like to search the document by identifier pull the title and website separately and enter them into an excel sheet separately.  The identifiers are already listed in excel and I would like them to match up with the appropriate information.</p>

<p>I know its really, really messy - </p>

<pre><code>Public Sub ParseDoc()

Dim list As Workbook
Dim doc As Document
Set doc = "C:\network\path\importantlist.doc"
Dim paras As Paragraphs
Set paras = doc.Paragraphs
Dim para As Paragraph
Dim sents As Sentences
Dim sent As Range
Set list = ActiveSheet
Dim i As Integer
Dim mystring As String
Dim length As Integer
Dim space As String
Dim dot As String
Dim space1 As String
Dim space2 As String
Dim XYZ As Range

dot = "."
space = " "
i = 1

While i &lt; 300 'This loops for the duration of the identifier list in excel 
    mystring = Cells(i, 1) ' this pulls the unique identifier from the cell
For Each para In paras

    Set sents = para.Range.Sentences  ' this searches the document by paragraphs to sentences
    For Each sent In sents
        If InStr(1, sent, mystring) &lt;&gt; 0 Then 'If a the identifier is found
            space1 = InStr(1, sent, space, vbTextCompare) 'measure the length to the first blank space (this indicates the title is about to begin)
            space2 = InStr(1, sent, dot, vbTextCompare) ' This dot is the ".doc" and indicates the title has concluded, I want the text between these two characters
                Set XYZ =
                Start:= space1.range.start
                End:= space2.range.start
               'Here is where I am stuck, I have never used range or selection before and after looking around, I still feel very much at a loss on how to proceed forward... 




    Next

Next

End Sub
</code></pre>