Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to click only unread mails in Gmail using vb script
#9
Not Solved
Hi,

I wrote a small piece of code to check unread mails in gmail.
try it.

Code:
Set excel = CreateObject("Excel.Application")
excel.Workbooks.Open("C:\gmail.xls")
Set sheet = excel.Sheets("Sheet1")

Set objLink = Description.Create()
objLink("html tag").value = "A"

Set objSearch = Browser("title:=Gmail.*").Page("title:=Gmail .*").ChildObjects(objLink)
row = 1
For i=35 to 84 'There are many links but mail (subject) link starts from index 35. Presuming that there are 50 mails per page

     str = objSearch(i).getROProperty("innerhtml")

     If instr(1,str ,"<B>",1)>0 Then 'identifies unread mail by checking whether the font is bold
        sheet.cells(row,1) = objSearch(i).getROProperty("innertext") ' Writes the subject of unread emails in excelsheet from row.
        row=row+1
        j=j+1 'Counts total number of unread mails
     End If

Next

excel.ActiveWorkbook.Save
excel.Quit
msgbox "You have " & j &" unread mail(s)"
Reply


Messages In This Thread
RE: How to click only unread mails in Gmail using vb script - by Gulbarga - 01-09-2012, 01:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to delete particular mails in Gmail using QTP rajkumarsm 1 4,181 10-06-2014, 07:03 PM
Last Post: rajkumarsm
  Right Click On a Image and Click on a Link in WebElement RameshKrishnan 4 5,415 07-10-2013, 04:13 PM
Last Post: RameshKrishnan
  Delete Gmail email newqtp 4 4,747 07-05-2013, 02:12 PM
Last Post: Staff
  Total no of mail in gmail excellentpawan 2 3,157 07-05-2013, 01:56 PM
Last Post: Staff
  gmail signout dropdown thru DP zakshah.12 0 2,310 03-05-2013, 07:47 AM
Last Post: zakshah.12

Forum Jump:


Users browsing this thread: 4 Guest(s)