How to create a word document using VBscript in QTP?

How to create a word document using VBscript in QTP?

Dim oWordDocument

‘ To initaiate a Word Document object

Set oWordDocument = CreateObject(“Word.Application”)

oWordDocument.Documents.Add

‘ type words on documents

oWordDocument.Selection.TypeText “This is 1st line text on word file ” & vbnewline & “This is 2nd line text on word file”

oWordDocument.ActiveDocument.SaveAs “C:\SampleWordDoc.doc”

oWordDocument.Quit

Set oWordDocument=Nothing