I am in a project (Automation) where i need to work on microsoft outlook, in general QTP Tool doesn't recognize MSOutlook, So we need to work on MAPI's. so, where shall i need to get code to work on MAPI's. Can anyone please provide me the link/ else please let me know, how to search for code in Google.

Showing Answers 1 - 2 of 2 Answers

msusmitha

  • Jan 25th, 2007
 

hi uma Qtp supports any operating system out looki am sure that ms outlook also takened as a windows application, write a basic script for opening the outlook application, it will workjust put the qtp under record and open the ms out look and do what ever u want to, automatically it will generate the script. i think u understoodsusmithamadhav_sus@yahoo.co.in

  Was this answer useful?  Yes

Bhamini

  • Feb 10th, 2007
 

you cannot work with any ms office products like a windows application.you have to understand the object model provided by MSDN and script accordingly.for example:Sending Emails using outlook through QTP Script Dim ToAddress Dim MessageSubject Dim MessageBody Dim MessageAttachment Dim ol, ns, newMail SystemUtil.Run "C:Program FilesMicrosoft OfficeOffice10OUTLOOK.EXE" 'or where yours is ToAddress = "abc@yahoo.com" ' Email Address u want to send Set ol = CreateObject("Outlook.Application") Set ns = ol.GetNamespace("MAPI") For i = 1 to 2 Set newMail = ol.CreateItem(0) If i =1 Then MessageSubject = "This is a test mail1" MessageBody = "This the message for testing. " End If If i = 2 Then MessageSubject = "This is a test mail2 " MessageBody = "This the message for testing. " End If newMail.Subject = MessageSubject newMail.Body = MessageBody & vbCrLf newMail.Recipients.Add(ToAddress) 'newMail.Attachments.Add("C:Test.txt") 'u can send attachment also newMail.Send Next Set ns = Nothing Set ol = Nothing

  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.