I'm stumped; I've played around and adapted the following from some code that I found here (thanks yall) and I can ALMOST get what I need, but not quite.
If you see the following text, I am trying to retrieve the paragraph that is after I have searched and found the common text "Purpose/scope:". The code below selects all of it. I'd like to copy the text either into field in another word doc, or into an access field, but for right now all I'm really concerned about is how to select and copy only paragraph following purpose/scope, not the entire section.
PURPOSE/SCOPE: This procedure will provide the guidelines to assist the Technician in the shutdown of the Towers.
Here's my code: (once again, "borrowed" from this site)
Sub searchtext()
Dim rng As Range
Dim para As Paragraph
Dim sSearch$
sSearch = "Purpose/Scope:"
Set rng = ActiveDocument.Range
With rng.Find
.Execute Findtext:=sSearch
Selection.MoveRight Unit:=wdWord, Count:=1
End With
Set para = rng.Paragraphs(1)
Set rng = para.Range
For Each para In rng.Paragraphs
If Selection.Find.Execute(sSearch, Wrap:=wdWrapAlways) = True Then
rng.Start = Selection.Range.Start
rng.Expand Unit:=wdParagraph
rng.Select
rng.Copy
Else
MsgBox "Searchtext " & sSearch & " not found."
End If
Next para
End Sub
Thanks in advance!
Traci