Micro Focus QTP (UFT) Forums
QTP Code to check received emails in outlook - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: QTP Code to check received emails in outlook (/Thread-QTP-Code-to-check-received-emails-in-outlook)



QTP Code to check received emails in outlook - ritugoyal - 01-27-2010

Hi All,

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

Regards,
Ritu


RE: QTP Code to check received emails in outlook - Saket - 01-27-2010

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