| |
Jasper
Posts: 1
Score: 0
Joined: 10/15/2003
From:
Status: offline
|
Dear all, I just started working with VBS. I made a script to be able to count all emails in our callcenter. The script I use is the following: Dim objOutlook, objNameSpace, lItemCount, lLinePos, objExcel, myFolder Dim strFolders strFolders = "inbox|Z-Distribution|2.FWD" On Error Resume Next Set objExcel= CreateObject("Excel.Application") objExcel.visible=False objExcel.DisplayAlerts = False Set oWB = objExcel.Workbooks.Add lLinePos = 1 strFolders = "|" & strFolders & "|" Set objOutlook = CreateObject("Outlook.application") Set objNameSpace = objOutlook.GetNameSpace("MAPI") For Each myfolder In objNameSpace.Folders EnumFolders myfolder Next Set objNameSpace = Nothing Set objOutlook = Nothing oWB.SaveAs "C:\Count.xls" objExcel.Quit Set objExcel = Nothing Sub EnumFolders(oFolder) For Each oFolder In oFolder.Folders If instr(1,strFolders,"|" & oFolder.name & "|",1)>0 then oWB.ActiveSheet.Cells(lLinePos,1).Value=oFolder.name oWB.ActiveSheet.Cells(lLinePos,2).Value=oFolder.Items.Count lLinePos = lLinePos + 1 end if If oFolder.Folders.Count > 0 Then EnumFolders oFolder Next End Sub My problem is the following. I have a map called XXX. In this map there are email read, emails unread and emails with flags for following up etc. I like to count in this map the sum of the email read and unread and the number of email with another status. Is someone willing to help me with this? Best Regards, Jasper
|
|