how to record a word doc using qtp i.e open a word doc,type
something and save the doc

can someone send me the code.

Answers were Sorted based on User's Feedback



how to record a word doc using qtp i.e open a word doc,type something and save the doc can some..

Answer / ashok

This did not work. Displayed error " Object doesn't
support th is property or method 'doc.selection'

Can you please also send code for the following:"
Read word doc. Get font. Get Italic. Get Bold.

Is This Answer Correct ?    0 Yes 0 No

how to record a word doc using qtp i.e open a word doc,type something and save the doc can some..

Answer / vijay

Set word = CreateObject("Word.Application")
Set doc = word.documents.Add
word.visible = True
word.selection.typetext " Open MSWord"
doc.saveAs "C:vin.doc"
word.quit
Set word = nothing
Set doc = nothing

Is This Answer Correct ?    0 Yes 1 No

how to record a word doc using qtp i.e open a word doc,type something and save the doc can some..

Answer / chaitu

Dim word
Dim doc

Set word = CreateObject("Word.Application")
Set doc = word.documents.Add
word.visible = True
doc.selection.typetext " Open MSWord"
doc.saveAs "C:\chaitu.doc"
word.quit
Set word = nothing
Set doc = nothing

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More QTP Interview Questions

how to run the script If QTP tool not identify object in web page

2 Answers  


I have a tool bar where 5 different buttons are placed, but these buttons are not traceable hence i have created a virtual object on save button of this toolbar. Now pls tell me how to use this virtual object while write script.

0 Answers   IBM,


what is the defference between QTP 8.2 and 9.0and 9.2? plz tell me

6 Answers  


This is Ajay i have few douts if anybody know pls give me reply. 1. i have opend 2 gmails i am working with 1 gmail i want to close other gmail by usig script. 2.i have 10 links in a page all of them have same properties& names i want to click on 5link by using script. 3.i have one combobox in that i want to see all the citynames in the combobox and i have to check weather hyderabad is present or not. 4. size of objectrepository. 5.what r problems we get during writing the script. 6.is it possible to compare to excel sheets in qtp if possible wht is the script. 7.example for lowlevelrecording

3 Answers   Symantic Space,


Anybody can tell me what are the common roles and responsibilites of a Automation Test engineer

2 Answers   IBM,






Which method do you use to retrieve data from the WebList object?

1 Answers  


How does QTP identify an object?

0 Answers  


i am testing an online shopping application.I CLICK on a link "ADD TO CART" of that application a "new page" is open and then click on any object of that "new page". after that when i run this SCRIPT then on this "new page" QTP always shows error of "OBJECT NOT FOUND". How i solve this problem ?

4 Answers  


Can anyone tell me about "Step- By Step Paramterization". among the two paramaterizations, Step by step and Parameterize All, which one is mostly used.

0 Answers  


I have an application running in Linux server. I am reaching the application through emulators like telnet. My operating system at the client side is Windows XP. Using emulator I am connecting the Linux server and working on the application. Can I automate the testing of the software running in Linux server using QTP. In short, does QTP support the applications running in Linux servers.

1 Answers  


How to capture dynamic values in load runner and how Each of the captured values are to be written to a text file (c:\temp\LoadRunner1.txt)

0 Answers   TCS,


Write a script to delete the a specific row (say 3rd) in a webtable.

0 Answers  


Categories