Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP:How to find an email with a subject line in MS outlook and then click on an link
#2
Not Solved
Create a folder for that particular Type of mail
and check in that folder
Code:
Option Explicit

    Dim dicEmailAddresses
    Dim strLogFolder
    Dim strEmail

    strLogFolder = "C:Program FilesSpare BackupLogs"
    Set dicEmailAddresses = GetEmailAddressesFromLogs(strLogFolder)

    For Each strEmail In dicEmailAddresses.Keys()
        WScript.Echo strEmail
    Next

    Function GetEmailAddressesFromLogs(StrSource)
        Dim oFSO
        Set oFSO = CreateObject("Scripting.FileSystemObject")
        Dim oFolder
        Dim strLine
        Dim dicResults
        Dim strEmail
        Dim oFile
        Set oFile = oFSO.GetFolder(strLogFolder)


        Set dicResults = CreateObject("Scripting.Dictionary")
        For Each oFile In oFSO.GetFolder(strSource).Files
            For Each strLine In Split(oFile.ReadAll(), VbCrLf)
                If InStr(strLine, "INFO: Logging in ") > 1 Then
                    strEmail = Split(strLine, "INFO: Logging in ")(1)
                    If Not dicResults.Exists(strEmail) Then
                        dicResults.Add strEmail, ""
                    End If
                End If
            Next
        Next

    Set GetEmailAddressesFromLogs = dicResults End Function
Has this answred your question?
Reply


Messages In This Thread
RE: QTP:How to find an email with a subject line in MS outlook and then click on an link - by Arun Prakash - 08-18-2010, 05:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extracting Email Body from Outlook waseem.khan.91 0 2,184 03-04-2019, 02:53 PM
Last Post: waseem.khan.91
  Extracting Email Body from Outlook waseem.khan.91 0 1,203 03-01-2019, 02:51 PM
Last Post: waseem.khan.91
  Find the email using subject with the help of vb script Raheem Shaik 0 1,702 12-12-2018, 02:57 PM
Last Post: Raheem Shaik
  How to catch the script execution when QTP scripts are executed from command line Sreeni.lutukurthy 0 2,943 03-19-2015, 05:55 PM
Last Post: Sreeni.lutukurthy
  how to randomly Select any category link and randomly click on one of its options ? sharavan 0 2,929 11-18-2014, 12:24 AM
Last Post: sharavan

Forum Jump:


Users browsing this thread: 1 Guest(s)