title: MS Word VBA How to Search and copy selected text to beginning of the Paragraph
body: <p>I want to search and copy year specified in the paragraph and copy it to beginning of the paragraph. following is the code i am working with, it does selects the year but doesn't copy it to the beginning:</p>
  
  <pre><code>Sub CopyYeartoFirst()
  '
  ' Macro1 Macro
  '
  '    Selection.Find.ClearFormatting
  With ActiveDocument.Content
      With Selection.Find
          .Text = "[0-9]{4}"
          .Replacement.Text = ""
          .Forward = True
          .Wrap = wdFindContinue
          .Format = False
          .MatchCase = False
          .MatchWholeWord = False
          .MatchAllWordForms = False
          .MatchSoundsLike = False
          .MatchWildcards = True
          .Execute
      End With
  While .Find.Found = True
  
      Selection.Copy
      Selection.HomeKey Unit:=wdLine
      Selection.PasteAndFormat (wdPasteDefault)
      'Selection.TypeText Text:=" -- "
      .Find.Execute
  
      'Selection.Find.ClearFormatting
  Wend
  
  
  End With
  End Sub
  </code></pre>