Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Counting with VSB in Outlook

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,915
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Counting with VSB in Outlook
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Counting with VSB in Outlook - 10/15/2003 4:17:29 AM   
  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
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Counting with VSB in Outlook Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts