Sunday 10 March 2013

How to read mail from outlook in QTP

 How to read mail from outlook in QTP

Code below can be used to read an email from mailbox folder of microsoft outlook.

Set appOutl = Wscript.CreateObject("Outlook.Application")
Set objSession = appOutl.GetNameSpace("MAPI")

'  6 = "Inbox"
'  9 = "Calendar"
' 10 = "Contacts"


  Set MyFolder = objSession.GetDefaultFolder(6)
  Msgbox MyFolder.name & ", " & MyFolder.Items.Count
  Set myItems = myFolder.Items

  For I = 1 to MyFolder.Items.Count
      MsgBox MyItems(I).subject & " : " &  MyItems(I).body
' display subject and body of all email from inbox.
  Next

No comments:

Post a Comment

Please Leave your reply. We value your feedback and inputs

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.