title: MS WORD VBA Find Replace text using a variable
body: <p>I have a variable (strLastname) that I use to send a string to a bookmark. That works well.
  I also wish to use that variable to replace temporary text "Name>" in a long document.</p>
  
  <p>This is what I have now.</p>
  
  <pre><code>  Sub cmdOK_Click()
      Dim strLastname As String   ' from dialogue box "BoxLastname" field
      strLastname = BoxLastname.Value
  ....
    End sub
  </code></pre>
  
  <p>The macro that does not work:</p>
  
  <pre><code>Sub ClientName()
  
  Selection.Find.ClearFormatting
  Selection.Find.Replacement.ClearFormatting
  With Selection.Find
      .Text = "Name&gt;"
      .Replacement.Text = strLastname??????
  
               'Selection.TypeText (strLastname) ????
                'How to use the variable from the Dialogue Box - strLastname????
  
       End With
    Selection.Find.Execute Replace:=wdReplaceAll
  End Sub
  </code></pre>
  
  <p>I tried 
  .<code>Replacement.Text = strLastname  and   .Replacement.Text = BoxLastname.Value</code>   but no one work.</p>