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

plz anybody tell me how to explain the architecture of one particular project.plz give me answer for this.....RAJESH

7 Answers   Wipro, TCS,


Tell me the QTP Advantages and Disadvatages ?

1 Answers  


What is Automation frame work.How we will prepare in real time.

9 Answers   AppLabs,


what is regular expression how will you implement it?

1 Answers  


how to write xml output check point bu useing descriptive programing .means without useing output check point

0 Answers  






i'm using QTP 8.2, How should i select(browse) object repository from desktop(or from local local drives like C:\,D:\)?. Note:- object repository to select(browse) is been sent by some other person who is using QTP 9.0

1 Answers  


What is obsolute path and relative path in QTP..? How to access them and what are the differences between them...??

3 Answers   Virtusa,


How to get the format of a webedit class in qtp. How can i know that particular webedit accept what type of format like "mm/dd/yyyy" or "$" or Alphanumeric

0 Answers  


Write the Test Cases for ATM(Any Time Money)

3 Answers   SpaceLabs,


i want know iam working 2+ exp in QTP can i do performence testing (eg:loadrunner) yes r no?

6 Answers   IBM,


Get the count of files of similar types from a folder.

0 Answers   Deloitte,


Plz Explain AUTOMATION REFERENCE MODEL?

0 Answers  






Categories