Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Identify Read Recepits (http://www.outlookbanter.com/outlook-vba/100166-identify-read-recepits.html)

Sanya Ibrahim February 16th 10 05:11 AM

Identify Read Recepits
 
Hi,
I am using Outlook 2007. In the NewMail event, is it possible to identify if
the MailItem is a read receipt?
Could someone help me?
Thanks in advance.


Ken Slovak - [MVP - Outlook] February 16th 10 02:08 PM

Identify Read Recepits
 
Look for a MessageClass property that starts with "REPORT.IPM.Note" and ends
with "IPNRN" to identify a read receipt.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Sanya Ibrahim" Sanya wrote in message
...
Hi,
I am using Outlook 2007. In the NewMail event, is it possible to identify
if
the MailItem is a read receipt?
Could someone help me?
Thanks in advance.



Sanya Ibrahim[_2_] February 17th 10 03:31 AM

Identify Read Recepits
 
Thanks for the reply.
Well, I am rather new to OutLook vba. Is it possible for you to give a
sample / example code?
Sanya

"Ken Slovak - [MVP - Outlook]" wrote:

Look for a MessageClass property that starts with "REPORT.IPM.Note" and ends
with "IPNRN" to identify a read receipt.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Sanya Ibrahim" Sanya wrote in message
...
Hi,
I am using Outlook 2007. In the NewMail event, is it possible to identify
if
the MailItem is a read receipt?
Could someone help me?
Thanks in advance.


.


Ken Slovak - [MVP - Outlook] February 17th 10 02:14 PM

Identify Read Recepits
 
Well, for one thing I wouldn't use NewMail(). It doesn't tell you what was
received and it misses things. I'd use NewMailEx() instead, which supplies a
list of items received as a list of EntryID's.

Always use F2 to open the Object Browser and that lets you see all methods,
properties and events for all Outlook items. Then use the Help to see code
samples. In the case of Application.NewMailEx() the code sample shows how to
get an item from the collection of EntryID's. That item (mai) can be used
thusly to check the MessageClass:

If ((Left(mai.MessageClass, Len("REPORT.IPM.Note")) = _
"REPORT.IPM.Note") And (Right(mail.MessageClass, _
Len("IPNRN")) = "IPNRN")) Then

' this is a read receipt, do whatever

End If

You should also become familiar with the www.outlookcode.com Web site, that
has code samples for almost anything Outlook related.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Sanya Ibrahim" wrote in message
...
Thanks for the reply.
Well, I am rather new to OutLook vba. Is it possible for you to give a
sample / example code?
Sanya



Sanya Ibrahim[_2_] February 19th 10 03:23 PM

Identify Read Recepits
 
Well, I tried it. I am getting into a strange situation wherein:-
(a) The EntryCollection argument has string values
(b) I split the EntryCollection string on "," and use the individual
EntryID strings to retrieve the mail Items
(c) However, the GetItemFromID(EntryID) returns nothing. The EntryID
argument is not null and the value does not correspond to the new inmail.

What to do?

"Ken Slovak - [MVP - Outlook]" wrote:

Well, for one thing I wouldn't use NewMail(). It doesn't tell you what was
received and it misses things. I'd use NewMailEx() instead, which supplies a
list of items received as a list of EntryID's.

Always use F2 to open the Object Browser and that lets you see all methods,
properties and events for all Outlook items. Then use the Help to see code
samples. In the case of Application.NewMailEx() the code sample shows how to
get an item from the collection of EntryID's. That item (mai) can be used
thusly to check the MessageClass:

If ((Left(mai.MessageClass, Len("REPORT.IPM.Note")) = _
"REPORT.IPM.Note") And (Right(mail.MessageClass, _
Len("IPNRN")) = "IPNRN")) Then

' this is a read receipt, do whatever

End If

You should also become familiar with the www.outlookcode.com Web site, that
has code samples for almost anything Outlook related.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Sanya Ibrahim" wrote in message
...
Thanks for the reply.
Well, I am rather new to OutLook vba. Is it possible for you to give a
sample / example code?
Sanya


.


Ken Slovak - [MVP - Outlook] February 19th 10 04:29 PM

Identify Read Recepits
 
That is the correct procedure, and it has worked that way for me in the
past.

Are you using a StoreID argument? I'd try that and see if it helps. You can
get Inbox using NameSpace.GetDefaultFolder(olFolderInbox) and use the
StoreID property from that object.

Are you getting any exceptions or just nothing?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Sanya Ibrahim" wrote in message
...
Well, I tried it. I am getting into a strange situation wherein:-
(a) The EntryCollection argument has string values
(b) I split the EntryCollection string on "," and use the individual
EntryID strings to retrieve the mail Items
(c) However, the GetItemFromID(EntryID) returns nothing. The EntryID
argument is not null and the value does not correspond to the new inmail.

What to do?



Sanya Ibrahim[_2_] February 20th 10 04:45 AM

Identify Read Recepits
 
I am using a storeID arguement. I am not getting any exception but the
MaiItem is showing as nothing.

Sanya

Ken Slovak - [MVP - Outlook] February 22nd 10 01:59 PM

Identify Read Recepits
 
No idea. Similar code works here. Step the code in the debugger and see if
you can find out that way what the problem is.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Sanya Ibrahim" wrote in message
...
I am using a storeID arguement. I am not getting any exception but the
MaiItem is showing as nothing.

Sanya




All times are GMT +1. The time now is 11:32 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com