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
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 |
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 |
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 |
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 |
In an interview, what r the general questions asked in QTP? pls give me anwser to this question?
What is Terminal Emulators”? Why we used in QTP.? How he works on QTP.
Can anybody post some real time scenario in qtp? please its very urgent.
write vb script code to delete the duplicate values in an array.
In qtp, how you can get the last character from a string?
What is the difference between analog and low level recording?
how do close the task manager through QTP?
Explain data driven framework?
How can we log a defect in Testdirector from Q.T.P ?
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.
How many ways is to parameterize the value?
In qtp, explain what is keyword driven automation framework?