Wednesday, 28 May 2014

How to Create a Word Document in QTP?

Dim oWord

'Initiate the word document object

Set oWord = CreateObject("Word.Application")

'Create new word document
oWord.Documents.Add

'Type some characters in the newly created document
oWord.Selection.TypeText "Dhana Test Text"
 

'Save the document
oWord.ActiveDocument.SaveAs "c:\Dhana\Test.Doc
 

'Close word
oWord.Quit

'Release the object
Set oWord = Nothing

0 comments:

Post a Comment

 
Back To Top