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

HOW CAN WE GET THE VALUE OF TEXT BOX IN QTP? can you give me sample script for this where there is some condition. like if "text" THEN msgbox() else endif

7 Answers   Xavient,


How to data driven test for Win objects in QTP ?

0 Answers  


whow much strong on VB and C?

0 Answers   UHG,


action contains public and private functions but do we resuable that action or not..If it is reusable How..plz tell me the ans

0 Answers   TCS,


give the code to count child objects (Total) in the page

1 Answers  






In a web application , there is a table of rows and coloums , i want to pickup the 1st row and 3rd coloums name (not data)how can any one explain

4 Answers   Polaris,


Explain about random testing of 500 test cases?

1 Answers   IBM,


What is difference between version 6.5 and 8.2 in QTP?

0 Answers  


Plz Explain AUTOMATION REFERENCE MODEL?

0 Answers  


.have you ever written compiled module? if yes , tell me about some of the function that you wrote.

0 Answers   TCS,


Where virtual objects stores results?

4 Answers  


What is the maximum size of Object Repository in QTP 8.2?

4 Answers   Mphasis,






Categories