'Before this script executes, you need to have a "Greetings.doc" in C drive and it contains some information. In that information each line is contains a word "Good". Now my objective is to Replace the word "Good" with "Bad". And save file with new name.
################################################################
Set Word = CreateObject("Word.Application")
Word.Visible = TRUE
Set WordDoc=Word.Documents.Open ("C:\Greetings.doc")
Do
With Word.Selection.Find
.Text = "Good"
.Replacement.Text = "Bad"
.Forward = True
.wrap=1
.Format = False
.MatchWholeWord = True
End With
Word.Documents.Application.Selection.Find.Execute
If Word.Selection.Find.Found Then
Word.Selection.Range="bad"
else
Exit Do
End If
Loop
WordDoc.SaveAS "C:\BadGreetings.doc"
Important Topics & Useful Scripts on QTP. Ask your QTP related questions at this id - asrajaputra@gmail.com
Wednesday, January 14, 2009
QTP VB Script Trainings
Check out this SlideShare Presentation:
QTP VB Script Trainings
View SlideShare presentation or Upload your own.
QTP Shortcut Keys
Check out this SlideShare Presentation:
QTP Shortcut Keys
View SlideShare presentation or Upload your own.
Polish Your Skills For QTP Interview In MNC's
Check out this SlideShare Presentation:
How to Implement Keyword Driven Methodology in QTP
Check out this SlideShare Presentation: