That field isn't a default field. In other words it's not always there. If
an item in Inbox hasn't had any action taken on it that field won't be
there. After you send a reply, reply all or forward is when the field is
added.
With any code in CDO or RDO or MAPI you need to handle those cases. Where
the field doesn't exist clear the error and go on to the next item.
On Error Resume Next
For Each objmsg In cdoInbox.Messages
Set cdoField = objmsg.Fields(cdoPR_LAST_VERB_EXECUTED) 'error statement
If Err.Number 0 Then
Err.Clear
Else
MsgBox (cdoField.Value)
End If
Next
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Bhanu" wrote in message
...
Thanks for your reply.
As per your reply, I tried to implement the same in VBA(not using C#.Net).
But, I got an error which is mentioned below.
"cdoPR_LAST_VERB_EXECUTED" is giving error.
Run-time error '-2147221233(8004010f)':
Collaboration Data Objects
[Collaboration Data Objects - [MAPI_E_NOT_FOUND(8004010F)]]
'Code I have implemented
Dim cdoInbox As MAPI.Folder
Dim cdoSession As MAPI.Session
Dim objmsg As MAPI.Message
Dim cdoField As MAPI.Field
Set cdoSession = CreateObject("MAPI.Session")
cdoSession.Logon "outlook", "", False, False
'cdoSession.Logon newSession:=False
Set cdoInbox = cdoSession.Inbox
For Each objmsg In cdoInbox.Messages
Set cdoField = objmsg.Fields(cdoPR_LAST_VERB_EXECUTED) 'error
statement
MsgBox (cdoField.Value)
Next
Do you have any idea as to what could be the reason ?
Thanks
Bhanu
"Ken Slovak - [MVP - Outlook]" wrote:
The Outlook object model doesn't let you find that. You would need to use
a
different API such as CDO 1.21 or Extended MAPI or Redemption
(www.dimastr.com/redemption). Neither CDO or Extended MAPI can be used
from
..NET languages.
The property you would read would be PR_LAST_VERB_EXECUTED (0x10810003).
EXCHIVERB_REPLYTOSENDER = 102
EXCHIVERB_REPLYTOALL = 103
EXCHIVERB_FORWARD = 104
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Bhanu" wrote in message
...
Iam using C#.net for outlook programming.
I want to know whether a mail is replied/forwarded or not in my Inbox.
Are there any properties like replied/Isreplied/forwarded/Isforwarded
for a MailItem ??