QTP tutorials & interview questions


Search more on QTP here

VBScript - Inserting text into a new word file

VBScript - inserting text into new word file

'opening a new word document and writing text to it

set word = createobject("word.application")
word.visible=true
set doc = word.documents.add

Set objectSelection = Word.Selection
objectSelection.TypeText "This is sample text"

Also See:

Opening a new word document
Opening an existing word document
Opening an existing word document and appending text to it at the end
Opening an existing word document and appending text to it at the beginning
Saving a new word file
Saving an existing word file
Writing formatted text to a word file
Formatting all content, formatting specific paragraphs or finding and formatting specific text in a word document
Inserting images/pictures to a word file
Creating table in a word document, adding text to cells, adding rows to table
Printing a word file