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.......

Answer Posted / sanjay kardile

Hello,

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


Set objOutlookMail = CreateObject("Outlook.Application")
Set myMail = objOutlookMail.CreateItem(0)
myMail.Display
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 = "someone@someone.com"
myMail.Subject = "This Mail is from QTP. "
myMail.Send
End If

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

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the parameterization? Give one example?

578


Explain the types of object repositorys in qtp?

558


what are the challenges you have faced while testing web based application using the automation tools ?

579


Are Shared ORs read-only?

612


What are the ordinal identifiers in web page?

620






Hi, I got error message as "object does not support this property or method: "Test.Actions" when i execute the following line of script on QTP 9.0 Dim qtApp, qtRep Set qtApp = CreateObject("QuickTest.Application") Set qtRep = qtApp.Test.Actions("Action1").ObjectRepositories Can anyone tell me where i am wrong.

1504


How did you use regular expressions in QTP and also in WR?

2150


Hi Friends... By using QTP , can we test .net products...and that product supports different languages.. thanx in advance..

4111


Mention what are the different types of recording modes in qtp? Which will be used when?

548


Can any one tell me how to write a script for selecting open option in File menu of A word document.here you have to add objects to OR.try like that and give me the ans.i asked this question to so many but no one knows.if any one know the answer plz let me know

1392


How can you handle exceptions in qtp?

525


Hi, My name is kishan. I have good Conceptual Knowledge on QTP. In order to Boost up my Confidence Level, I want to do a Project oriented Training only on QTP in Hyderabad. Kindly Let me know which is the Best QTP Project Training Institute in Hyderabad. Thanks in Advance kishan

2045


What are the different types of functions available in qtp and explain ?

554


What are output values and why they are used ?

614


When I click on a link in web page.Link should open in new window.can anyone please let me know the script for this ---Koti

2473