Opening word document, copying specific text, paste into excel spreadsheet
<p>I am trying to make a VBA script that opens a word document, looks for a word that looks like "TPXXXX" where "X" are numbers, and then pastes that text into an excel spreadsheet. I can open up the word document, but I am having trouble selecting and finding the text I need. So far for that part I have:</p>

<pre><code>Sub Copy()

'Create variables
Dim Word As New Word.Application
Dim WordDoc As New Word.Document
Dim Doc_Path As String
Dim WB As Workbook
Dim WB_Name As String

Doc_Path = "C:\Path\To\File.docx"
Set WordDoc = Word.Documents.Open(Doc_Path)

'Find text and copy it (part that I am having trouble with)
Selection.Find.ClearFormatting
With Selection.Find
    .Text = "TP"
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
End With
Selection.Find.Execute
Selection.EscapeKey
Selection.MoveLeft Unit: wdCharacter , Count:=2
Selection.MoveRight Unit: wdCharacter , Count:=4
Selection.Copy

'Open excel workbook and paste
WB_Name = Application.GetOpenFilename(",*.xlsx")
Set WB = Workbooks.Open(WB_Name)

WB.Sheets("Sheet1").Select
Range("AB2").Select
ActiveSheet.Paste
WordDoc.Close
Word.Quit

End Sub
</code></pre>

<p>Can anyone give me some pointers?</p>