Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue with Outlook Object
#2
Not Solved
Hi Ankur,
how to check and close the all unread mails in outlook for this i tried some code, in this code loop is working fine.but its not reading unread mails and its taken only old mails.Please assist me on this.

My Code is :

Code:
Dim myOlApp,myFolder,strFilter,sTot_UnRed_mails

Set myOlApp = CreateObject("Outlook.Application")

Set myNameSpace = myOlApp.GetNameSpace("MAPI")
On Error Resume Next
Set myFolder=  myNameSpace.GetDefaultFolder(6)
sTot_UnRed_mails= myFolder.UnReadItemCount
'strFilter = "[UnRead] = True"
'Set ObjResMail_Items =ObjMail_Items.Restrict( strFilter )
'ObjResMail_Items.Sort "[UnRead]",True
For i= 1 to sTot_UnRed_mails
    If InStr(myFolder.Subject,sSubject) > 0 Then
        Set oItem = myFolder.Items(i)

        sSubject = oItem.Subject

        sBody = oItem.Body

        Reporter.ReportEvent micPass,"",""&sBody
        myFolder.UnRead = False

    End If
Next


Thanks,
prasad
prasad.vengala@gmail.com
Reply


Messages In This Thread
Issue with Outlook Object - by somu175734 - 12-19-2008, 10:54 AM
RE: Issue with Outlook Object - by prasad.vengala - 01-08-2009, 04:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Flex+Air object identification issue using UFT 11.5 prashantn 0 2,615 02-21-2014, 02:02 PM
Last Post: prashantn
  Security Warning in Outlook automation priyaang 2 3,925 02-19-2014, 01:50 PM
Last Post: priyaang
  Object Identification Issue for Client Server application in QTP 11 Prashanth Kichadi 5 6,390 07-19-2011, 06:23 PM
Last Post: Prashanth Kichadi
  fucntion to send mail in outlook works fine in qtpcode but does not work in .vbs Rashmi 2 4,064 06-13-2011, 09:55 PM
Last Post: byzoor
  Object repository issue while recording. rameshrise3 2 2,815 07-09-2010, 07:17 PM
Last Post: rameshrise3

Forum Jump:


Users browsing this thread: 1 Guest(s)