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

what is review

0 Answers  


How to Import the data from MS-Access in QTP?

1 Answers  


If I change the property value at runtime is it effect is object repository?

0 Answers  


Where is the Bitmap checkpoint information stored?

0 Answers   Ordain Solutions,


What is the Obect Repository type, we use in Automated Testing..in Real time.. Pls anybody can give the answer.. Thanks in advance...

5 Answers   Navis,






we add library file used in test via settings or through "ExecuteFile" command. when we implement framework do we make common library file and load the same for all the test cases execution?

0 Answers  


Explain about reusable actions?

3 Answers   IBM,


What is checkpoints for quicktest professional?

0 Answers  


Hi, While recording a Jave based web application, its recording all my actions and the objects.And I have 5 WebEdit objects on the page and all are recorded. But while execution, at the 2 WebEdit object, its entering the value into the object (Its making a call to the AJAX, matching the value), when the control get out of this object the value is erased or cleared. Could anyone please help. I have recoreded 5 more scenarios where WebEdit is in the picture on different webpages and all are working fine. Here is my Script: Browser("Sign In").Page("Matching Workbench_3").WebEdit ("locationLookup").Set "0320 - SEATTLE-KM" Browser("Sign In").Page("Matching Workbench_3").WebEdit ("supplierNameLookup").Set "TRAMMO PETROLEUM INC" *** SupplierNameLookup is the object, which is haing an issue. And also I was using the SendString function, but it didnt work.

0 Answers  


Can u call winRunner scripts from QTP?

4 Answers  


Why divide a test into three action calls?

1 Answers  


difference between GetRoProperry and GetToProperty.and where we've to use exactly those properties

5 Answers   Wipro,


Categories