PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming mail statistics

Reply

mail statistics

 
Thread Tools Rate Thread
Old 01-07-2003, 01:37 PM   #1
Jorn Lodahl
Guest
 
Posts: n/a
Default mail statistics


I want to count mails fulfilling certain criteria. I
believe a lot of people do this for statistic purposes,
but I was not able to find any hints on this on the web. I
hope you can give me a push in the right direction.

I would like a sub that count mails
- in folders inbox or ”deleted items”
- with sent date within last week
- marked as read
This just as one relevant example.

Thanks in advance

Jørn Lodahl
(In mail adress remove edu subdomain)
  Reply With Quote
Old 09-07-2003, 07:16 AM   #2
Jorn Lodahl
Guest
 
Posts: n/a
Default mail statistics

Since I've got not replies I take it that there are no
easy solutions.

For the record here is the heart of the solution I've
implemented, where I loop over all mails.

Jørn

intDeltaT = 7 '#dage
dtmOldDate = Now - intDeltaT

Set objFolderNyheder = GetFolder("Private mapper C-drev\.
inbox\Nyheder")
Set objFolderGamle = GetFolder("Private mapper C-drev\.
inbox\Nyheder\Gamle")
Set objFolderSlettede = GetFolder("Private mapper C-
drev\slettet post\slettede nyheder")

intLaeste = 0
intAnkomne = 0

Set colItems = objFolderNyheder.Items
Set objItem = colItems.GetFirst
Do Until objItem Is Nothing
If objItem.ReceivedTime < dtmOldDate Then
intAnkomne = intAnkomne + 1
If Not objItem.UnRead Then intLaeste = intLaeste +
1
End If
Set objItem = colItems.GetNext
Loop

Set objItem = Nothing
Set colItems = Nothing

If intAnkomne > 0 Then
str1 = Format((1 - intLaeste / intAnkomne), "0%")
Else
str1 = Format(0, "0%")
End If

MsgBox str1 & Chr(10) & strRes

Set objItem = Nothing
Set colItems = Nothing



>-----Original Message-----
>I want to count mails fulfilling certain criteria. I
>believe a lot of people do this for statistic purposes,
>but I was not able to find any hints on this on the web.

I
>hope you can give me a push in the right direction.
>
>I would like a sub that count mails
> - in folders inbox or ”deleted items”
> - with sent date within last week
> - marked as read
>This just as one relevant example.
>
>Thanks in advance
>
>Jørn Lodahl
>(In mail adress remove edu subdomain)
>.
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off