This macro searches for the phrase "S E G - D" and then copies the next 20 lines. It is supposed to continue doing this until the end of the document, stringing all of the occurances together, and then paste them all into a new document. This macro only does the first occurance.
other post link
http://www.ozgrid.com/forum/showthread.php?t=89720
Code:
Sub CopyParas()
Application.ScreenUpdating = False
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Text = "S E G - D"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do While Selection.Find.Execute
Selection.StartOf Unit:=wdLine
Selection.MoveEnd Unit:=wdLine
Selection.MoveDown Unit:=wdLine, Count:=20, Extend:=wdExtend
sBigString = sBigString + Selection.Text
Selection.MoveStart Unit:=wdLine
Loop
Documents.Add DocumentType:=wdNewBlankDocument
Selection.InsertAfter (sBigString)
Application.ScreenUpdating = True
End Sub
other post link
http://www.ozgrid.com/forum/showthread.php?t=89720