View Single Post
 
Old 08-20-2014, 12:59 PM
tariqaleed2 tariqaleed2 is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Jul 2014
Posts: 14
tariqaleed2 is on a distinguished road
Default

Thanks macropod for the advice and help .


This code was modified is working well , this is what I want, but it does not work in the text box, can possible modify it to be working in the text box
Greetings to all

Sub FindIt()
Dim blnFound As Boolean



Dim rngFound As Range
Dim strTheText As String


Application.ScreenUpdating = False
For i = 0 To 4
Selection.HomeKey wdStory
Selection.Find.Text = "TARIQ"
blnFound = Selection.Find.Execute
If blnFound Then
Selection.MoveStartWhile wdWord
Set rng1 = Selection.Range

ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:="FirstName"
End If
'move back to beginning
Selection.HomeKey wdStory
Next
Application.ScreenUpdating = True
End Sub
Reply With Quote