Purnima,
I found your script and ran it. I ran into a error. Can you check this out and let me know if I have something wrong?
Debugger finds the first line as the error.
Code:
Sub find_replace_all_files()
-----------------------------------------------------------------------------------
Sub find_replace_all_files()
Dim i As Integer
With Application.FileSearch
.FileName = "*.doc"
.LookIn = "C:\My Documents"
.Execute
If .FoundFiles.Count <> 0 Then
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Documents.Open ("C:\My Documents\" & .FoundFiles(i))
ActiveDocument.TrackRevisions = True
ActiveDocument.Select
With Selection.Find
.Text = "Quiksilver"
.Replacement.Text = "Quicksilver!"
.MatchWildcards = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveDocument.Save
ActiveDocument.Close
Next i
End If
MsgBox "Macro execution complete."
End With
I am curious, to change the words to find and substitute, you have to enter them in the code or when the code runs, it stops and asks the user to input?
If not then can a user input box be put in?
Doug