Finally, this code is required
Thank you macropod and thank for all
Sub FindIt11()
Application.ScreenUpdating = True
For i = 0 To 10
Selection.HomeKey wdStory
With ActiveDocument.Range.Find
.Text = "TARIQ"
.Forward = True
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceNone
If .Found = True Then
.Parent.Select
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:="FirstName"
End If
End With
For Each iShp2 In ActiveDocument.Shapes
If iShp2.TextFrame.HasText = True Then
With iShp2.TextFrame.TextRange.Find
.Text = "TARIQ"
.Execute Replace:=wdReplaceNone
If .Found = True Then
.Parent.Select
ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range,Name:="FirstName"
'
End If
End With
End If
Next iShp2
Next i
Application.ScreenUpdating = True
End Sub
|