mail statistics

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)
 
J

Jorn Lodahl

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top