mail statistics

  • Thread starter Thread starter Jorn Lodahl
  • Start date Start date
J

Jorn Lodahl

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)
 
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
 
Back
Top