Replace:
Code:
' Get the 1st paragraph
Set Rng = .Range.Paragraphs(1).Range
With Rng
' Contract the range to exclude the final paragraph break
.MoveEnd wdCharacter, -1
StrTxt = .Text
For k = 1 To Len(StrNoChr)
StrTxt = Replace(StrTxt, Mid(StrNoChr, k, 1), "_")
Next
End With
with:
Code:
' Get the 1st cell's content
StrTxt = Split(.Tables(1).Cell(1, 1).Range.Text, vbCr)(0)
For k = 1 To Len(StrNoChr)
StrTxt = Replace(StrTxt, Mid(StrNoChr, k, 1), "_")
Next
That said, since it's clear you have access to the mailmerge main document, one has to wonder why you don't use the approach mentioned in post #2.