10-01-2010, 02:55 AM
This should work better, and you weren't calling save:
Quote:Set obj_word = CreateObject("Word.Application")
Set obj_doc = obj_word.documents.Open("D:\QTP Practice\QTP.docx")
Set obj_words = obj_doc.Words
For i = 1 To obj_words.Count
obj_words.Item(i).Text = Replace(obj_words.Item(i).Text, "QTP", "Mercury")
Next
obj_doc.Save
obj_doc.Close
obj_word.Quit
Set obj_words = Nothing
Set obj_doc = Nothing
Set obj_word = Nothing