HI How to take screenshots of a Webpage and saving it in a
external word document using QTP.

Answers were Sorted based on User's Feedback



HI How to take screenshots of a Webpage and saving it in a external word document using QTP...

Answer / jegan

''Capture Currently display web page
Browser(objBrow).Page(objPag).CaptureBitmap "C:\Test.bmp",True

''Create word application
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

Set objRang = objDoc.Range()
Set objShape = objDoc.inlineShapes

''Add Picture to word file
objShape.AddPicture ("C:\Test" & ".bmp ")
objWord.Selection.TypeParagraph()

''Save Word File
objDoc.saveas("C:\Test.doc")

Is This Answer Correct ?    9 Yes 1 No

HI How to take screenshots of a Webpage and saving it in a external word document using QTP...

Answer / jkarurosu

I've tried the code and it works fine. I just have a question here, how can I add a second image at the end of the file. I've tried in different ways but the last image appears at the beginning of the file.

Is This Answer Correct ?    0 Yes 0 No

HI How to take screenshots of a Webpage and saving it in a external word document using QTP...

Answer / apurva

I am using the above code only.

''Create word application first
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

Set objRang = objDoc.Range()
Set objShape = objDoc.inlineShapes


"Capture Currently display web page
Browser(objBrow).Page(objPag).CaptureBitmap "C:\Test.bmp",True

''Add Picture to word file
objShape.AddPicture ("C:\Test" & ".bmp ")


"Capture Currently display web page
Browser(objBrow).Page(objPag).CaptureBitmap "C:\Test.bmp",True

''Save Word File
objDoc.saveas("C:\Test.doc")

Is This Answer Correct ?    0 Yes 1 No

HI How to take screenshots of a Webpage and saving it in a external word document using QTP...

Answer / sumit

Try this Jkarurosu:Use Movedown method

Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

'Set objRang = objDoc.Range()
Set objShape = objDoc.inlineShapes

''Add Picture to word file
fname="C:UsersPublicPicturesSample PicturesKoala.jpg"
fname2="C:UsersPublicPicturesSample PicturesTulips.jpg"
objShape.AddPicture (fname)
objWord.Selection.MoveDown 1,0
objWord.Selection.TypeParagraph()

objShape.AddPicture (fname2)
objWord.Selection.MoveDown 1,0
objWord.Selection.TypeParagraph()

''Save Word File
objDoc.saveas("C:UserssunshineDesktopTest.docx")

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More QTP Interview Questions

In an interview, what r the general questions asked in QTP? pls give me anwser to this question?

0 Answers  


What is Terminal Emulators”? Why we used in QTP.? How he works on QTP.

1 Answers  


Can anybody post some real time scenario in qtp? please its very urgent.

0 Answers   Kanbay,


write vb script code to delete the duplicate values in an array.

4 Answers   ADP,


In qtp, how you can get the last character from a string?

0 Answers  






What is the difference between analog and low level recording?

0 Answers  


how do close the task manager through QTP?

2 Answers  


Explain data driven framework?

0 Answers  


How can we log a defect in Testdirector from Q.T.P ?

2 Answers   EDS,


How vl i prioritize the actions when i have 10 actions A1, A2, A3......A10. I want to run action as follows A1,A5,A6 and A10. How i can do it. Thanks in Advance to u.

7 Answers   IBM, Wipro,


How many ways is to parameterize the value?

0 Answers  


In qtp, explain what is keyword driven automation framework?

0 Answers  


Categories