How to insert screenshot on to the body of outlook?
-1 how to use insert-picture tab in new email outlook to
insert image in the body.
Suggest something.......

How to insert screenshot on to the body of outlook? -1 how to use insert-picture tab in new email o..

Answer / sanjay kardile


You can try the below code. Hope this is help full.

Set objOutlookMail = CreateObject("Outlook.Application")
Set myMail = objOutlookMail.CreateItem(0)
Set myMailProperty = objOutlookMail.ActiveInspector

If myMailProperty.IsWordMail = "True" Then
Set myDoc = myMailProperty.WordEditor
' Insert text and Image in the body of the email
myDoc.Range.InsertBefore Chr(13) + "First line of the text at the bottom of the Image" + Chr(13) + " Second of the text at the bottom of the image"
myDoc.InlineShapes.AddPicture "C:\PrintScreen.png"
myDoc.Range.InsertBefore "First line of the text at the top of the Image" + chr(13) + "Second line of the text at the top of the Image" + Chr(13)

myMail.To = ""
myMail.Subject = "This Mail is from QTP. "
End If

Set myMail = Nothing
Set objOutlookMail = Nothing
Set myDoc = Nothing

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions


2 Answers  

Hi Frriends... I have one Query please give the apropriate ans. when we r working with web based application , the user loggedin page name is changed respect to the username ( Take a exp. .When we use Datadriven test to this scenario ,each time the loggedin page name is changed ...then the script is fail.. at that time wat can do... please give the apropriate ans. Thanx in advance..

3 Answers  

1) How will you associate SOR in Runtime? ( u had written 10 lines of code from 11th line u want associate what code u will write) 2) How will close n number of browser expect only one which is has to test? ( First tell me how will you identify how many browser are opened ) what logic u will use? 3) In web Table u want to click on link ( Link Name Mohamed ) you dont know in which row and column that link is there. how wil u identify and click on that link.

2 Answers  

How do we call Library Files(.vbs) in the Test Script Thanks in Advance...

6 Answers  

How to count the no of objects in XML file(QTP)

1 Answers   IBM,

Hi. GetRoProperty and OUTPUT Value Both are same purpose or not? plz explain in deatil with example?

5 Answers  

how can u find the syntax errors or other script errors in your test during the execution of your QTP Test - (i.e., not after the execution/test run finished, but before finishing the test run)

2 Answers   HCL,

what are the parameters you are considering for object identification?

1 Answers  

What is the use of "Step Generator" in QTP??for what purpose we are using??explain with an example

2 Answers  

why was automation used in the project?

1 Answers   Google,

7. Given scenario is like this: One Web table is there and you have to search and retrieve a cell data which is equal to the given number say:123. Assume you have given with the column name/id of the table where the number may exist. So now you have to go to the given column and search for the number 123 and retrieve it along with the row number of it.

4 Answers  

wht is Automation testing frame work. pls explain it

3 Answers   Wipro,