Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP Code to check received emails in outlook
#1
Solved: 2 Years, 11 Months, 1 Week, 5 Days, 6 Hours, 57 Minutes, 18 Seconds ago
Hi All,

Can any body tell me code to check whether particular email notification is received in outlook or not in QTP.

Regards,
Ritu
Reply
#2
Solved: 2 Years, 11 Months, 1 Week, 5 Days, 6 Hours, 57 Minutes, 18 Seconds ago
Try this
Code:
Set OlApp = CreateObject("Outlook.Application")
Set Inbox = OlApp.GetNamespace("Mapi").GetDefaultFolder(olFolderInbox)

Set InboxItems = Inbox.Items

For Each Mail In InboxItems
    If Mail.UnRead Then
    ...
    End If
Next

hope this helps

Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  QTP resets values of certain fields, while running (Code attached) niveditachan 1 1,470 02-04-2015, 03:55 PM
Last Post: anshika.agarwal
  Security Warning in Outlook automation priyaang 2 1,034 02-19-2014, 01:50 PM
Last Post: priyaang
  QTP with EMMA Code Coverage Tool Sdhar 2 2,493 09-23-2011, 05:59 AM
Last Post: Sdhar
  Code to export and import tests in qtp tpragnya 0 1,570 08-17-2011, 08:06 PM
Last Post: tpragnya
  fucntion to send mail in outlook works fine in qtpcode but does not work in .vbs Rashmi 2 2,406 06-13-2011, 09:55 PM
Last Post: byzoor



Users browsing this thread: 1 Guest(s)