• Subject: Re: Group by in VBA
  • Author: Amiable
  • Date: 10 Jun 2008
  • References: 1 2
Sue, I use exactly that right now, the problem is, I have several folders
underneath my mailbox root and underneath default folders like inbox, I take
one user at a time and have to iterate though all the folders and items in
them to find if the user+item+date matches, this serves my purpose but is
deadly slow when the number of items are many(some 5000), I was hoping if
there is something like a SQL query which is more efficient than this
method. See the code below

MySearchCriteria = "[Received] > '" & MyDateStart & "' and [Received] < '" &
MyDateEnd & "'"
Set MyResultItems = AllInboxItems.Restrict(MySearchCriteria)
MyResultItems.Sort ("[From]")

This however doesn't give me "group by"

-Am

"Sue Mosher [MVP-Outlook]" <suemvp@outlookcode.com> wrote in message
news:%23petdKwyIHA.3384@TK2MSFTNGP03.phx.gbl...
You can use the Items.Restrict method to filter by date range -- see
http://www.outlookcode.com/article.aspx?id=30 -- and add criteria for the
sender. The resulting Items collection will have a Count property.
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54

"Amiable" <achaudhary311@hotmail.com> wrote in message
news:eZASzpuyIHA.2184@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> I want to find out the number of emails sent by a particular user between
> specific dates and then find sum group by user name.
> Can anyone help me?
>
> A
>
>
10 Jun 2008Group by in VBA.Amiable
10 Jun 2008\ Re: Group by in VBA.Sue Mosher [MVP-Outlook]
10 Jun 2008   \ Re: Group by in VBA.Amiable
10 Jun 2008      \ Re: Group by in VBA.Sue Mosher [MVP-Outlook]
10 Jun 2008         \ Re: Group by in VBA.Amiable
All times are in (US) Eastern Daylight Time (GMT -4:00)