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 connect to oracle(sqlserver) database to QTP

3 Answers   CTS,


i want to handle all the unwanted pop up through QTP i done that with recovery scenario but it need some title of pop up but i want that it should handle all the pop up even i don't give the title of that pop up in recovery scenario is there any general way to handle all the pop up please help

3 Answers  


How would you directly trigger javascript in a test?

0 Answers   eBay,


Where we use data driver in qtp?

0 Answers  


Write script to fetch the data from global sheet where row number is 3 and parameter is "text"

3 Answers   Accenture, Thomson Reuters,






How to get align property of the link on web page?

1 Answers  


I have 5 save buttons in my application on 5 different tabs one after the another . I have spy them and added each of them in my OR. My Or is able to highlight each button on each of the 5 tabs. But when I run the script it does not click the object.Is there anything I have to edit in OR. Any property to add or delete? Below are the properties of 5 save buttons. My code for each is like browser().page().savebutton1.click Browser().page.savebutton2.click Properties of 5 buttons Dhopare, Namita Sent: September 2, 2015 2:57 PM To: Vullengala, Jagadeeshchandra "Class Name:=WebButton", "abs_x:=718", "abs_y:=693", "class:=Button", "disabled:=0", "height:=22", "html id:=btnSaveTab1", "html tag:=INPUT", "innerhtml:=", "innertext:=", "name:=Save", "outerhtml:=<input id=""btnSaveTab1"" class=""Button"" onclick=""document.getElementById('a1').click();"" name=""btnSaveTab1"" value=""Save"" type=""button"">", "outertext:=", "type:=button", "value:=Save", "visible:=True", "width:=41", "x:=718", "y:=616" "Class Name:=WebButton", "abs_x:=687", "abs_y:=571", "class:=Button", "disabled:=0", "height:=22", "html id:=btnSave", "html tag:=INPUT", "innerhtml:=", "innertext:=", "name:=Save", "outerhtml:=<input id=""btnSave"" class=""Button"" onclick=""document.getElementById('a2').click();"" value=""Save"" type=""button"">", "outertext:=", "type:=button", "value:=Save", "visible:=True", "width:=40", "x:=687", "y:=494" "Class Name:=WebButton", "abs_x:=635", "abs_y:=478", "class:=Button", "disabled:=0", "height:=23", "html id:=", "html tag:=INPUT", "innerhtml:=", "innertext:=", "name:=Save", "outerhtml:=<input class=""Button"" onclick=""document.getElementById('a3').click();"" value=""Save"" type=""button"">", "outertext:=", "type:=button", "value:=Save", "visible:=True", "width:=41", "x:=635", "y:=401" "Class Name:=WebButton", "abs_x:=695", "abs_y:=558", "class:=Button", "disabled:=0", "height:=22", "html id:=BtnExternalPartySve", "html tag:=INPUT", "innerhtml:=", "innertext:=", "name:=Save", "outerhtml:=<input id=""BtnExternalPartySve"" class=""Button"" onclick=""document.getElementById('a4').click();"" value=""Save"" type=""button"">", "outertext:=", "type:=button", "value:=Save", "visible:=True", "width:=41", "x:=695", "y:=481" "Class Name:=WebButton", "abs_x:=672", "abs_y:=642", "class:=Button", "disabled:=0", "height:=22", "html id:=", "html tag:=INPUT", "innerhtml:=", "innertext:=", "name:=Save", "outerhtml:=<input class=""Button"" onclick=""document.getElementById('a5').click();"" value=""Save"" type=""button"">", "outertext:=", "type:=button", "value:=Save", "visible:=True", "width:=40", "x:=672", "y:=565" Previous Item Next Item Connected to Microsoft Exchange

1 Answers  


Why we are selecting QTP for testing ?

20 Answers   HP,


how to display message with out using msgbox function?

5 Answers   AppLabs,


difference between multiple parameterization and data driven wizard in QTP?

1 Answers  


Please tell me the steps to record the test in Analog recording mode in QTP version 9.2???

2 Answers  


How to differentiate the webedit field like user name and password? Please tell any other best answer is ther

3 Answers   Navis,


Categories