Micro Focus QTP (UFT) Forums
Clicking a link in an outlook email using QTP - 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Clicking a link in an outlook email using QTP (/Thread-Clicking-a-link-in-an-outlook-email-using-QTP)



Clicking a link in an outlook email using QTP - kirti - 06-15-2014

Hi ,
I need to automate clicking on an activation link which is sent as part of an auto-generated email.

I am able to display the email,but unable to get QTP to focus on the link to click it.

Here's my code :

Code:
Set objOutlook = CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.GetNamespace("MAPI")

' Secondary mailbox
Set objFolder= objNameSpace.Folders(2)
'msgbox objFolder
' Display the mailbox
objFolder.display()
'Set the Folder
Set InboxFolder =objFolder.Folders("Inbox")
msgbox "Opened " &objFolder
    

For Each x In InboxFolder.Items
        x.Display
'Exit the for loop once the first email is found  
Exit For  
Next


The email contains a link that I need to click on.

Any suggestions /help will be highly appreciated.

Thanks,
Kirti