View Single Post
 
Old 04-01-2014, 05:40 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,350
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You haven't integrated the code I gave you with the rest of your code - all you've done is add it to the module.

Try:
Code:
Sub CopyParas()
Dim TargetList, i As Long, sBigString As String, Doc As Document
TargetList = InputBox("Put list of terms to find here, separated by commas")
For i = 0 To UBound(Split(TargetList, ","))
  With ActiveDocument.Range
    With .Find
      .ClearFormatting
      .Text = "[!^13]@" & Split(TargetList, ",")(i) & "*^13"
      .Forward = True
      .Wrap = wdFindStop
      .Format = False
      .MatchWildcards = True
      .Execute
    End With
    Do While .Find.Found
      sBigString = sBigString & .Text
      .Collapse wdCollapseEnd
      .Find.Execute
    Loop
  End With
Next
Set Doc = Documents.Add(DocumentType:=wdNewBlankDocument)
Doc.Range.Text = sBigString
Set Doc = Nothing
End Sub
Although my implementation differs, the principle is the same.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote