![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I have a script:
Public Sub CountMessagesSent() Dim Items As Outlook.Items Dim ResultItems As Outlook.Items Dim Filter As String Dim DayRange As Long Dim record As String DayRange = -1 Set Items = Application.Session.GetDefaultFolder(olFolderSentM ail).Items Filter = "[SentOn] = '" & DateAdd("d", DayRange, Date) & "'" Set ResultItems = Items.Restrict(Filter) MsgBox "Yesterday: " & ResultItems.Count Open "C:\Users\Jeff\Desktop\Work Shortcuts\Hotkey Responses\EmailsSent.txt" For Output As #1 record = Yesterday & "," & ResultItems.Count Print #1, record Close #1 End Sub Which is SUPPOSED to count only yesterdays emails, but instead I get all email sent from yesterday to current. I am very new to VB, so any help with an explanation would be great! ![]() Thanks!! |
Ads |
#2
|
|||
|
|||
![]()
Anyone have an idea?
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is there a way to count # of emails in a pst? | hammerhead13 | Outlook - General Queries | 4 | July 18th 08 01:34 AM |
get a count of total contacts & count in a category? | Nick Chargin MBA CRS | Outlook - Using Contacts | 3 | January 17th 08 07:40 AM |
Keeping Count of emails received each day | Murphybp2 | Outlook and VBA | 3 | August 30th 07 07:17 AM |
Is there a quick way to count how many emails are in my .PST file(s) | ship | Outlook - General Queries | 3 | October 30th 06 09:22 PM |
Keeping Count of Emails | Murphybp2 | Outlook and VBA | 3 | August 15th 06 03:06 PM |