Automate Microsoft OutLook objects in QTP

What are the add-ins needed to automate Microsoft OutLook objects.
I am trying to automate outlook using QTP. But it is not recognizing outlook objects properly.
I want click on mails one by one and want to read mail details from inbox.
I have VB, .NET, web, active X and wpf addins.

Thanks

Questions by spandey123

Showing Answers 1 - 9 of 9 Answers

sruthi

  • Aug 28th, 2011
 

Automate MS Outlook Operations using QTP?

SendTo=".......@........com"
SendToCC=".......@........com"
Subject="QTP mail"
Body1="This mail is generated from QTP Environment"
Attachment="C:Spec.xls"

Call SendMail(SendTo, Subject, Body1, Attachment)

Function SendMail(SendTo, Subject, Body, Attachment)
Set ol=CreateObject("Outlook.Application")
Set Mail=ol.CreateItem(0)
'ol.DisplayAlerts = False
Mail.to=SendTo
Mail.CC=SendToCC
Mail.Subject=Subject
Mail.Body=Body
If (Attachment <> "") Then
Mail.Attachments.Add(Attachment)
End If
Mail.Send
ol.Quit
Set Mail = Nothing
Set ol = Nothing
End Function

  Was this answer useful?  Yes

Pankaj Sharma

  • Aug 31st, 2011
 

You need to use create instance for outlook.application class that will be a good option but if you do it by that you have to handle an alert window by the help of shell. Scripting class instance using pass key. The best idea would be create a macro and call that macro from QTP .

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions