PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Count received mails of yesterday

Reply

Count received mails of yesterday

 
Thread Tools Rate Thread
Old 10-08-2004, 10:26 AM   #1
Martin Los
Guest
 
Posts: n/a
Default Count received mails of yesterday


I have a macro counting:
1. nº answered mails yesterday
2. nº pending mails from yesterday

Then I concluded that the nº of received mails must have
been the sum of 1+2 (or: received mails yesterday =
answered mails yesterday + pending mails , error!!!!).

The error consist in the fact that the answered mails
yesterday could have been received before the day of
yesterday!!!

So how can I correct this?
I already have the macro checking the send mail folder and
checking for "send date = yesterday". What I miss is a
check for "received date = yesterday" as well?

Any tips are greatly welcomed! TIA

Martin

  Reply With Quote
Old 10-08-2004, 12:48 PM   #2
Lars Roland
Guest
 
Posts: n/a
Default Re: Count received mails of yesterday

On Tue, 10 Aug 2004, Martin Los wrote:

> So how can I correct this?
> I already have the macro checking the send mail folder and
> checking for "send date = yesterday". What I miss is a
> check for "received date = yesterday" as well?
>


You can use MAPI to get to the email and then use the ReceivedTime
method on the mail item.


Regards

Lars Roland.
  Reply With Quote
Old 10-08-2004, 02:30 PM   #3
Martin Los
Guest
 
Posts: n/a
Default Re: Count received mails of yesterday

Dear Lars:

Since I am not used to MAPI programming, do you have any
example?

TIA

Martin
>-----Original Message-----
>On Tue, 10 Aug 2004, Martin Los wrote:
>
>> So how can I correct this?
>> I already have the macro checking the send mail folder

and
>> checking for "send date = yesterday". What I miss is a
>> check for "received date = yesterday" as well?
>>

>
>You can use MAPI to get to the email and then use the

ReceivedTime
>method on the mail item.
>
>
>Regards
>
>Lars Roland.
>.
>

  Reply With Quote
Old 10-08-2004, 02:59 PM   #4
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Count received mails of yesterday

What about using MailItem.ReceivedTime from the Outlook object model?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Martin Los" <anonymous@discussions.microsoft.com> wrote in message
news:358a01c47ede$3eed11e0$a501280a@phx.gbl...
> Dear Lars:
>
> Since I am not used to MAPI programming, do you have any
> example?
>
> TIA
>
> Martin
> >-----Original Message-----
> >On Tue, 10 Aug 2004, Martin Los wrote:
> >
> >> So how can I correct this?
> >> I already have the macro checking the send mail folder

> and
> >> checking for "send date = yesterday". What I miss is a
> >> check for "received date = yesterday" as well?
> >>

> >
> >You can use MAPI to get to the email and then use the

> ReceivedTime
> >method on the mail item.
> >
> >
> >Regards
> >
> >Lars Roland.
> >.
> >



  Reply With Quote
Old 10-08-2004, 03:29 PM   #5
Lars Roland
Guest
 
Posts: n/a
Default Re: Count received mails of yesterday

Go with Sue's example, it is much easier - heh i did not think of that
one, sorry.

Regards.

Lars Roland


On Tue, 10 Aug 2004, Sue Mosher [MVP-Outlook] wrote:

> What about using MailItem.ReceivedTime from the Outlook object model?
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "Martin Los" <anonymous@discussions.microsoft.com> wrote in message
> news:358a01c47ede$3eed11e0$a501280a@phx.gbl...
> > Dear Lars:
> >
> > Since I am not used to MAPI programming, do you have any
> > example?
> >
> > TIA
> >
> > Martin
> > >-----Original Message-----
> > >On Tue, 10 Aug 2004, Martin Los wrote:
> > >
> > >> So how can I correct this?
> > >> I already have the macro checking the send mail folder

> > and
> > >> checking for "send date = yesterday". What I miss is a
> > >> check for "received date = yesterday" as well?
> > >>
> > >
> > >You can use MAPI to get to the email and then use the

> > ReceivedTime
> > >method on the mail item.
> > >
> > >
> > >Regards
> > >
> > >Lars Roland.
> > >.
> > >

>
>
>

  Reply With Quote
Old 11-08-2004, 11:57 AM   #6
Martin Los
Guest
 
Posts: n/a
Default Re: Count received mails of yesterday

I am afraid the task is a bit more complex. Let me try and
explain. I give an easy example:

In the olFolderSentMail I have 20 messages I sent
yesterday; 5 messages are "original" messages (= "New" I
created and sent them) and 15 are responses (= "Reply" to
an answer to a received message in my Inbox).

Of those 15 responses I wrote, 12 emails were originally
received the same day (=yesterday), but 3 were received
before yesterday!

Checking messages in olFolderSentMail for ReceivedTime
will give me the time the olFolderSentMail received the
answered mail. BUT IT WILL NOT TELL ME WHEN I RECEIVED THE
ORIGINAL MESSAGE I RESPONDED TO!
To check for the date received I guess I should look into
the body of the responded message (or does a property
exist that tells me the received date of a responded
message?).

Any ideas? TIA

Martin
>-----Original Message-----
>Go with Sue's example, it is much easier - heh i did not

think of that
>one, sorry.
>
>Regards.
>
>Lars Roland
>
>
>On Tue, 10 Aug 2004, Sue Mosher [MVP-Outlook] wrote:
>
>> What about using MailItem.ReceivedTime from the Outlook

object model?
>>
>> --
>> Sue Mosher, Outlook MVP
>> Author of
>> Microsoft Outlook Programming - Jumpstart for
>> Administrators, Power Users, and Developers
>> http://www.outlookcode.com/jumpstart.aspx
>>
>>
>> "Martin Los" <anonymous@discussions.microsoft.com>

wrote in message
>> news:358a01c47ede$3eed11e0$a501280a@phx.gbl...
>> > Dear Lars:
>> >
>> > Since I am not used to MAPI programming, do you have

any
>> > example?
>> >
>> > TIA
>> >
>> > Martin
>> > >-----Original Message-----
>> > >On Tue, 10 Aug 2004, Martin Los wrote:
>> > >
>> > >> So how can I correct this?
>> > >> I already have the macro checking the send mail

folder
>> > and
>> > >> checking for "send date = yesterday". What I miss

is a
>> > >> check for "received date = yesterday" as well?
>> > >>
>> > >
>> > >You can use MAPI to get to the email and then use the
>> > ReceivedTime
>> > >method on the mail item.
>> > >
>> > >
>> > >Regards
>> > >
>> > >Lars Roland.
>> > >.
>> > >

>>
>>
>>

>.
>

  Reply With Quote
Old 11-08-2004, 12:49 PM   #7
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Count received mails of yesterday

A sent message that is a reply contains no property related to the arrival
time of the original message that was replied to, but you are correct that
the body of the message would contain that date, assuming you don't delete
Outlook's automatic reply header.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Martin Los" <anonymous@discussions.microsoft.com> wrote in message
news:3f9a01c47f91$f9ff7370$a501280a@phx.gbl...
> I am afraid the task is a bit more complex. Let me try and
> explain. I give an easy example:
>
> In the olFolderSentMail I have 20 messages I sent
> yesterday; 5 messages are "original" messages (= "New" I
> created and sent them) and 15 are responses (= "Reply" to
> an answer to a received message in my Inbox).
>
> Of those 15 responses I wrote, 12 emails were originally
> received the same day (=yesterday), but 3 were received
> before yesterday!
>
> Checking messages in olFolderSentMail for ReceivedTime
> will give me the time the olFolderSentMail received the
> answered mail. BUT IT WILL NOT TELL ME WHEN I RECEIVED THE
> ORIGINAL MESSAGE I RESPONDED TO!
> To check for the date received I guess I should look into
> the body of the responded message (or does a property
> exist that tells me the received date of a responded
> message?).
>
> Any ideas? TIA
>
> Martin
> >-----Original Message-----
> >Go with Sue's example, it is much easier - heh i did not

> think of that
> >one, sorry.
> >
> >Regards.
> >
> >Lars Roland
> >
> >
> >On Tue, 10 Aug 2004, Sue Mosher [MVP-Outlook] wrote:
> >
> >> What about using MailItem.ReceivedTime from the Outlook

> object model?
> >>
> >> "Martin Los" <anonymous@discussions.microsoft.com>

> wrote in message
> >> news:358a01c47ede$3eed11e0$a501280a@phx.gbl...
> >> > Dear Lars:
> >> >
> >> > Since I am not used to MAPI programming, do you have

> any
> >> > example?
> >> >
> >> > TIA
> >> >
> >> > Martin
> >> > >-----Original Message-----
> >> > >On Tue, 10 Aug 2004, Martin Los wrote:
> >> > >
> >> > >> So how can I correct this?
> >> > >> I already have the macro checking the send mail

> folder
> >> > and
> >> > >> checking for "send date = yesterday". What I miss

> is a
> >> > >> check for "received date = yesterday" as well?
> >> > >>
> >> > >
> >> > >You can use MAPI to get to the email and then use the
> >> > ReceivedTime
> >> > >method on the mail item.



  Reply With Quote
Old 11-08-2004, 02:30 PM   #8
Martin Los
Guest
 
Posts: n/a
Default Re: Count received mails of yesterday

How to accesing the body of the message I can read in your
book I recently bought Sue.

2 months ago Dmitry Streblechenko said that with
Redemption, Extended MAPI or CDO 1.21 it is posible to:

1. read PR_CONVERSATION_INDEX property and find an e-mail
in the Sent Items folder with the same value of
PR_CONVERSATION_INDEX property plus 5 bytes.

2. read PR_MESSAGE_DELIVERY_TIME and
PR_LAST_VERB_EXECUTION_TIME (0x10820040), which last
property is what Outlook uses when it displays "You
replied on..." or "You forwarded this message on...".

How does these extended MAPI properties help me find an
answer to my question?
I need tipos how to interpret these properties!

TIA

MArtin

>-----Original Message-----
>A sent message that is a reply contains no property

related to the arrival
>time of the original message that was replied to, but you

are correct that
>the body of the message would contain that date, assuming

you don't delete
>Outlook's automatic reply header.
>
>--
>Sue Mosher, Outlook MVP
>Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
>"Martin Los" <anonymous@discussions.microsoft.com> wrote

in message
>news:3f9a01c47f91$f9ff7370$a501280a@phx.gbl...
>> I am afraid the task is a bit more complex. Let me try

and
>> explain. I give an easy example:
>>
>> In the olFolderSentMail I have 20 messages I sent
>> yesterday; 5 messages are "original" messages (= "New" I
>> created and sent them) and 15 are responses (= "Reply"

to
>> an answer to a received message in my Inbox).
>>
>> Of those 15 responses I wrote, 12 emails were originally
>> received the same day (=yesterday), but 3 were received
>> before yesterday!
>>
>> Checking messages in olFolderSentMail for ReceivedTime
>> will give me the time the olFolderSentMail received the
>> answered mail. BUT IT WILL NOT TELL ME WHEN I RECEIVED

THE
>> ORIGINAL MESSAGE I RESPONDED TO!
>> To check for the date received I guess I should look

into
>> the body of the responded message (or does a property
>> exist that tells me the received date of a responded
>> message?).
>>
>> Any ideas? TIA
>>
>> Martin
>> >-----Original Message-----
>> >Go with Sue's example, it is much easier - heh i did

not
>> think of that
>> >one, sorry.
>> >
>> >Regards.
>> >
>> >Lars Roland
>> >
>> >
>> >On Tue, 10 Aug 2004, Sue Mosher [MVP-Outlook] wrote:
>> >
>> >> What about using MailItem.ReceivedTime from the

Outlook
>> object model?
>> >>
>> >> "Martin Los" <anonymous@discussions.microsoft.com>

>> wrote in message
>> >> news:358a01c47ede$3eed11e0$a501280a@phx.gbl...
>> >> > Dear Lars:
>> >> >
>> >> > Since I am not used to MAPI programming, do you

have
>> any
>> >> > example?
>> >> >
>> >> > TIA
>> >> >
>> >> > Martin
>> >> > >-----Original Message-----
>> >> > >On Tue, 10 Aug 2004, Martin Los wrote:
>> >> > >
>> >> > >> So how can I correct this?
>> >> > >> I already have the macro checking the send mail

>> folder
>> >> > and
>> >> > >> checking for "send date = yesterday". What I

miss
>> is a
>> >> > >> check for "received date = yesterday" as well?
>> >> > >>
>> >> > >
>> >> > >You can use MAPI to get to the email and then use

the
>> >> > ReceivedTime
>> >> > >method on the mail item.

>
>
>.
>

  Reply With Quote
Old 11-08-2004, 06:48 PM   #9
Dmitry Streblechenko \(MVP\)
Guest
 
Posts: n/a
Default Re: Count received mails of yesterday

You will need to read these properies from the messages in both the Inbox
and Sent Item folders to to find out how the messages are related.
Did you look at the messages with MdbView or OutlookSpy (click IMessage) to
ply with these properties?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"Martin Los" <anonymous@discussions.microsoft.com> wrote in message
news:3e3b01c47fa7$5f0781d0$a301280a@phx.gbl...
> How to accesing the body of the message I can read in your
> book I recently bought Sue.
>
> 2 months ago Dmitry Streblechenko said that with
> Redemption, Extended MAPI or CDO 1.21 it is posible to:
>
> 1. read PR_CONVERSATION_INDEX property and find an e-mail
> in the Sent Items folder with the same value of
> PR_CONVERSATION_INDEX property plus 5 bytes.
>
> 2. read PR_MESSAGE_DELIVERY_TIME and
> PR_LAST_VERB_EXECUTION_TIME (0x10820040), which last
> property is what Outlook uses when it displays "You
> replied on..." or "You forwarded this message on...".
>
> How does these extended MAPI properties help me find an
> answer to my question?
> I need tipos how to interpret these properties!
>
> TIA
>
> MArtin
>
> >-----Original Message-----
> >A sent message that is a reply contains no property

> related to the arrival
> >time of the original message that was replied to, but you

> are correct that
> >the body of the message would contain that date, assuming

> you don't delete
> >Outlook's automatic reply header.
> >
> >--
> >Sue Mosher, Outlook MVP
> >Author of
> > Microsoft Outlook Programming - Jumpstart for
> > Administrators, Power Users, and Developers
> > http://www.outlookcode.com/jumpstart.aspx
> >
> >
> >"Martin Los" <anonymous@discussions.microsoft.com> wrote

> in message
> >news:3f9a01c47f91$f9ff7370$a501280a@phx.gbl...
> >> I am afraid the task is a bit more complex. Let me try

> and
> >> explain. I give an easy example:
> >>
> >> In the olFolderSentMail I have 20 messages I sent
> >> yesterday; 5 messages are "original" messages (= "New" I
> >> created and sent them) and 15 are responses (= "Reply"

> to
> >> an answer to a received message in my Inbox).
> >>
> >> Of those 15 responses I wrote, 12 emails were originally
> >> received the same day (=yesterday), but 3 were received
> >> before yesterday!
> >>
> >> Checking messages in olFolderSentMail for ReceivedTime
> >> will give me the time the olFolderSentMail received the
> >> answered mail. BUT IT WILL NOT TELL ME WHEN I RECEIVED

> THE
> >> ORIGINAL MESSAGE I RESPONDED TO!
> >> To check for the date received I guess I should look

> into
> >> the body of the responded message (or does a property
> >> exist that tells me the received date of a responded
> >> message?).
> >>
> >> Any ideas? TIA
> >>
> >> Martin
> >> >-----Original Message-----
> >> >Go with Sue's example, it is much easier - heh i did

> not
> >> think of that
> >> >one, sorry.
> >> >
> >> >Regards.
> >> >
> >> >Lars Roland
> >> >
> >> >
> >> >On Tue, 10 Aug 2004, Sue Mosher [MVP-Outlook] wrote:
> >> >
> >> >> What about using MailItem.ReceivedTime from the

> Outlook
> >> object model?
> >> >>
> >> >> "Martin Los" <anonymous@discussions.microsoft.com>
> >> wrote in message
> >> >> news:358a01c47ede$3eed11e0$a501280a@phx.gbl...
> >> >> > Dear Lars:
> >> >> >
> >> >> > Since I am not used to MAPI programming, do you

> have
> >> any
> >> >> > example?
> >> >> >
> >> >> > TIA
> >> >> >
> >> >> > Martin
> >> >> > >-----Original Message-----
> >> >> > >On Tue, 10 Aug 2004, Martin Los wrote:
> >> >> > >
> >> >> > >> So how can I correct this?
> >> >> > >> I already have the macro checking the send mail
> >> folder
> >> >> > and
> >> >> > >> checking for "send date = yesterday". What I

> miss
> >> is a
> >> >> > >> check for "received date = yesterday" as well?
> >> >> > >>
> >> >> > >
> >> >> > >You can use MAPI to get to the email and then use

> the
> >> >> > ReceivedTime
> >> >> > >method on the mail item.

> >
> >
> >.
> >



  Reply With Quote
Old 12-08-2004, 04:28 PM   #10
Martin Los
Guest
 
Posts: n/a
Default Re: Count received mails of yesterday

Unfortunately the 30days trial period has already passed
for OutlookSpy, which I have used with great fun!

How can I get Mdbview if I do not posses the Exchange 5.5
cd? Is it a free program that can be found on Internet?

Does anybody know whether addins exist that measure things
like "average speed of answer" and "service level" (= nº
emails answered within time limit of say 24hours / total
nº emails received in 24 hours)?

I work in a service call center and I want to find out
this information to asses the quality that we provide to
our customers.

TIA

Martin
>-----Original Message-----
>You will need to read these properies from the messages

in both the Inbox
>and Sent Item folders to to find out how the messages are

related.
>Did you look at the messages with MdbView or OutlookSpy

(click IMessage) to
>ply with these properties?
>
>Dmitry Streblechenko (MVP)
>http://www.dimastr.com/
>OutlookSpy - Outlook, CDO
>and MAPI Developer Tool
>
>
>"Martin Los" <anonymous@discussions.microsoft.com> wrote

in message
>news:3e3b01c47fa7$5f0781d0$a301280a@phx.gbl...
>> How to accesing the body of the message I can read in

your
>> book I recently bought Sue.
>>
>> 2 months ago Dmitry Streblechenko said that with
>> Redemption, Extended MAPI or CDO 1.21 it is posible to:
>>
>> 1. read PR_CONVERSATION_INDEX property and find an e-

mail
>> in the Sent Items folder with the same value of
>> PR_CONVERSATION_INDEX property plus 5 bytes.
>>
>> 2. read PR_MESSAGE_DELIVERY_TIME and
>> PR_LAST_VERB_EXECUTION_TIME (0x10820040), which last
>> property is what Outlook uses when it displays "You
>> replied on..." or "You forwarded this message on...".
>>
>> How does these extended MAPI properties help me find an
>> answer to my question?
>> I need tipos how to interpret these properties!
>>
>> TIA
>>
>> MArtin
>>
>> >-----Original Message-----
>> >A sent message that is a reply contains no property

>> related to the arrival
>> >time of the original message that was replied to, but

you
>> are correct that
>> >the body of the message would contain that date,

assuming
>> you don't delete
>> >Outlook's automatic reply header.
>> >
>> >--
>> >Sue Mosher, Outlook MVP
>> >Author of
>> > Microsoft Outlook Programming - Jumpstart for
>> > Administrators, Power Users, and Developers
>> > http://www.outlookcode.com/jumpstart.aspx
>> >
>> >
>> >"Martin Los" <anonymous@discussions.microsoft.com>

wrote
>> in message
>> >news:3f9a01c47f91$f9ff7370$a501280a@phx.gbl...
>> >> I am afraid the task is a bit more complex. Let me

try
>> and
>> >> explain. I give an easy example:
>> >>
>> >> In the olFolderSentMail I have 20 messages I sent
>> >> yesterday; 5 messages are "original" messages

(= "New" I
>> >> created and sent them) and 15 are responses

(= "Reply"
>> to
>> >> an answer to a received message in my Inbox).
>> >>
>> >> Of those 15 responses I wrote, 12 emails were

originally
>> >> received the same day (=yesterday), but 3 were

received
>> >> before yesterday!
>> >>
>> >> Checking messages in olFolderSentMail for

ReceivedTime
>> >> will give me the time the olFolderSentMail received

the
>> >> answered mail. BUT IT WILL NOT TELL ME WHEN I

RECEIVED
>> THE
>> >> ORIGINAL MESSAGE I RESPONDED TO!
>> >> To check for the date received I guess I should look

>> into
>> >> the body of the responded message (or does a property
>> >> exist that tells me the received date of a responded
>> >> message?).
>> >>
>> >> Any ideas? TIA
>> >>
>> >> Martin
>> >> >-----Original Message-----
>> >> >Go with Sue's example, it is much easier - heh i did

>> not
>> >> think of that
>> >> >one, sorry.
>> >> >
>> >> >Regards.
>> >> >
>> >> >Lars Roland
>> >> >
>> >> >
>> >> >On Tue, 10 Aug 2004, Sue Mosher [MVP-Outlook] wrote:
>> >> >
>> >> >> What about using MailItem.ReceivedTime from the

>> Outlook
>> >> object model?
>> >> >>
>> >> >> "Martin Los" <anonymous@discussions.microsoft.com>
>> >> wrote in message
>> >> >> news:358a01c47ede$3eed11e0$a501280a@phx.gbl...
>> >> >> > Dear Lars:
>> >> >> >
>> >> >> > Since I am not used to MAPI programming, do you

>> have
>> >> any
>> >> >> > example?
>> >> >> >
>> >> >> > TIA
>> >> >> >
>> >> >> > Martin
>> >> >> > >-----Original Message-----
>> >> >> > >On Tue, 10 Aug 2004, Martin Los wrote:
>> >> >> > >
>> >> >> > >> So how can I correct this?
>> >> >> > >> I already have the macro checking the send

mail
>> >> folder
>> >> >> > and
>> >> >> > >> checking for "send date = yesterday". What I

>> miss
>> >> is a
>> >> >> > >> check for "received date = yesterday" as

well?
>> >> >> > >>
>> >> >> > >
>> >> >> > >You can use MAPI to get to the email and then

use
>> the
>> >> >> > ReceivedTime
>> >> >> > >method on the mail item.
>> >
>> >
>> >.
>> >

>
>
>.
>

  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