![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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 ?? |
Ads |
#2
|
|||
|
|||
![]()
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 ?? |
#3
|
|||
|
|||
![]()
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 ?? |
#4
|
|||
|
|||
![]()
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 ?? |
#5
|
|||
|
|||
![]()
Great, That's working. Thanks alot.
But I started getting one exception while reading "Undeliverable Mails(by System Administrator) which are in my mailbox. The exception is "Specified Cast is Invalid". The code I have written is below : for(int j=1; j=folder.Items.Count; j++) { subjectItem = (Outlook.MailItemClass)(folder.Items[j]); //error statement } but it is giving an exception mentioned above, while reading "Undeliverable Mails". More help is needed on how to handle such mails........ Thanks Bhanu "Ken Slovak - [MVP - Outlook]" wrote: 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 ?? |
#6
|
|||
|
|||
![]()
You have to handle errors, all errors, in any COM addin. In this case if
there's an error just handle it and clear the error object. You may run into other problems trying to use CDO 1.21 from a .NET application. It looks like your code is C# and use of CDO with the COM Interop is not supported by MS. It might work and it might work most of the time but you will run into things that just won't work or will fire errors. -- 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 ... Great, That's working. Thanks alot. But I started getting one exception while reading "Undeliverable Mails(by System Administrator) which are in my mailbox. The exception is "Specified Cast is Invalid". The code I have written is below : for(int j=1; j=folder.Items.Count; j++) { subjectItem = (Outlook.MailItemClass)(folder.Items[j]); //error statement } but it is giving an exception mentioned above, while reading "Undeliverable Mails". More help is needed on how to handle such mails........ Thanks Bhanu |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
replying to forwarded mail | Bill | Outlook - General Queries | 0 | February 25th 06 04:15 AM |
Keep copy of forwarded messages in Inbox | Linnane | Outlook - General Queries | 5 | February 16th 06 09:34 AM |
when forwarding vcards, no attachment is forwarded | Santiago Molina | Outlook - Using Contacts | 3 | February 10th 06 10:07 PM |
Saving a forwarded contact from someonelse into my contacts | Lisa dP | Outlook - Using Contacts | 1 | January 31st 06 12:15 PM |
How do I delete addresses from a forwarded attachment | DAfromca | Outlook - General Queries | 3 | January 14th 06 10:02 PM |