I am trying to create a macro using Word's "Find and select all the highlighted words" ("the" in this trial run) to then copy them and paste into a new document. The macro, which I have tried recording various ways (i.e., from the beginning of the porcess, from having allteh words already highlighted, etc.) fails each time, indicating as the culprit the last line that I have included here, Selection.Copy, wiht a note that nothing is selected. I have had no luck searching or trying to otherwise create a "save selection" command in simpler recorded macros. Can you tell me the trick to this? Thanks in advance.
Code:
Sub Macro1()
'
' Macro1 Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Highlight = True
With Selection.Find
.Text = "the"
.Replacement.Text = "the"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Copy