title: Find-replace code through vba gets ignored
body: <p>I cannot seem to get the VBA code that finds and replaces words in the word document to work. 
  I can find the words in the word document manually, but the vba code has no effect.</p>
  
  <p>Hello,</p>
  
  <p>I am trying to create a custom form in word through an excel input sheet. My issue is that the code that finds and replaces the words in the word document gets ignored in vba even while the word document is open (I can manually find the words in the document). Opening the word file through VBA is not an issue.</p>
  
  <p>Could someone please show me how to find and replace words in my word document?</p>
  
  <p>As displayed in the code below, I alreay tried the "With.WordDoc.Content.find" method without success.</p>
  
  <p>Below I added the code to find one of the words</p>
  
  <p>Thank you!</p>
  
  <pre><code>Sub CreateWordDocuments()
  
  Dim DocLoc, TagName, TagValue, TemplName, FileName As String
  Dim WordDoc, Wordapp As Object
  Dim RownumDocLoc As Integer
  
  Dim inputsheet As Worksheet
  Set inputsheet = ThisWorkbook.Sheets("Input")
  
  Dim templatesheet As Worksheet
  Set templatesheet = ThisWorkbook.Sheets("Templates")
  
  
  inputsheet.Activate
  templaterow = Application.Match("Template:", Columns("B:B"), 0)
  
  
  If inputsheet.Cells(templaterow, 4) = "" Then
          MsgBox "Please complete the template criteria", , "No template selected"
          inputsheet.Cells(1, 1).Select
          Exit Sub
  End If
  
  
  TemplName = inputsheet.Cells(templaterow, 4)
  
  
  templatesheet.Activate
  RownumDocLoc = Application.Match(TemplName, Columns("F:F"), 0)
  DocLoc = templatesheet.Cells(RownumDocLoc, 7) &amp; "\" &amp; TemplName
  
  
  
  'Open Word Template
  On Error Resume Next 
  Set Wordapp = GetObject("Word.Application")
  
  If Err.Number &lt;&gt; 0 Then 
  
  Err.Clear
  Set Wordapp = CreateObject("Word.Application")
  Wordapp.Visible = True 
  
  End If
  
  'Open Template
  Set WordDoc = Wordapp.documents.Open(FileName:=DocLoc, ReadOnly:=False)
  
  With WordDoc.Content.Find
      .Text = "samplestring"
      .Replacement.Text = "adjustedstring"
      .wrap = wdFindContinue
      .Execute Replace:=wdReplaceall
  End With
  
  
  End Sub
  </code></pre>
  
  <p>I would expect the string "samplestring" to be adjusted to "adjustedstring" in the word file. However nothing happens when the code runs (no errors).</p>