![]() |
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
|
|||
|
|||
![]()
My Outlook add-in handles NewInspector event of the Inspector object, in
order to display a custom form for the mail item. I can get EntryID of the CurrentItem of the Inspector object which is passed as a parameter of the event. But, the problem is that the EntryID of the current mail item is shorter than it should be, and is unknown. I know every EntryID of every mail item that was created, and i can see that specific mail item has a wrong EntryID. What is wrong? -- Nenad Dobrilovic |
Ads |
#2
|
|||
|
|||
![]()
Does this involve Exchange server?
Exchange related stores (mailboxes and public folders) can supply 2 types of EntryID to you, short-term and long-term. The long-term id is permanent as long as the item is in the same store and folder, the short-term id is valid only for that Outlook session. When Outlook or another API compares 2 EntryID values using the MAPI CompareIDs method it accounts for both types of EntryID, so the comparison works even if short and long term id's are being compared. That won't work using a simple equality comparison. In MAPI terms if you get a MAPITable object of a folder's Items collection you can request both the short and long-term ids. If you get a null or empty value for the long-term id you then grab the short-term id. Again in MAPI terms, the property tag for the short-term id is PR_ENTRYID = 0x0FFF0102 and for the long-term id is PR_LONGTERM_ENTRYID_FROM_TABLE = 0x66700102. If you are using the Outlook object model then any methods that take the EntryID, such as NameSpace.GetItemFromID() will accept either of those id values and treat them as the same, and will return the same item no matter which id is used in the method call. -- 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 "Nenad Dobrilovic" wrote in message news ![]() My Outlook add-in handles NewInspector event of the Inspector object, in order to display a custom form for the mail item. I can get EntryID of the CurrentItem of the Inspector object which is passed as a parameter of the event. But, the problem is that the EntryID of the current mail item is shorter than it should be, and is unknown. I know every EntryID of every mail item that was created, and i can see that specific item has a wrong EntryID. What is wrong? -- Nenad Dobrilovic |
#3
|
|||
|
|||
![]()
Thank you for the detailed answer.
I didn't give you all relevant information, sorry. Exchange Server was involved, and MailItem was saved after creating and moved to the external pst file later. The idea is to remember every EntryID of the MailItem that was created by an add-in, so that it can be treated differently later. Problem was that EntryID of the item opened by an Inspector was the short one, and not in the list of remembered ids, although it should be. Few lines of code where I was creating mail item we item.Save(); item.Move(some_folder); items_list.Add(item.EntryID); Folder 'some_folder' is inside of external non-default PST, so mail item gets new EntryID. I changed those lines to: item.Save(); item = (Outlook.MailItem)item.Move(some_folder); items_list.Add(item.EntryID); Now, item has a new EntryID, which can be found later. -- Nenad Dobrilovic "Ken Slovak - [MVP - Outlook]" wrote: Does this involve Exchange server? Exchange related stores (mailboxes and public folders) can supply 2 types of EntryID to you, short-term and long-term. The long-term id is permanent as long as the item is in the same store and folder, the short-term id is valid only for that Outlook session. When Outlook or another API compares 2 EntryID values using the MAPI CompareIDs method it accounts for both types of EntryID, so the comparison works even if short and long term id's are being compared. That won't work using a simple equality comparison. In MAPI terms if you get a MAPITable object of a folder's Items collection you can request both the short and long-term ids. If you get a null or empty value for the long-term id you then grab the short-term id. Again in MAPI terms, the property tag for the short-term id is PR_ENTRYID = 0x0FFF0102 and for the long-term id is PR_LONGTERM_ENTRYID_FROM_TABLE = 0x66700102. If you are using the Outlook object model then any methods that take the EntryID, such as NameSpace.GetItemFromID() will accept either of those id values and treat them as the same, and will return the same item no matter which id is used in the method call. -- 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 "Nenad Dobrilovic" wrote in message news ![]() My Outlook add-in handles NewInspector event of the Inspector object, in order to display a custom form for the mail item. I can get EntryID of the CurrentItem of the Inspector object which is passed as a parameter of the event. But, the problem is that the EntryID of the current mail item is shorter than it should be, and is unknown. I know every EntryID of every mail item that was created, and i can see that specific item has a wrong EntryID. What is wrong? -- Nenad Dobrilovic |
#4
|
|||
|
|||
![]()
Don't forget that EntryID will change when an item is moved from one store
to another (mailbox to PST for example). If you were using a lower level API such as Extended MAPI, CDO 1.21 or Redemption (www.dimastr.com/redemption) you could use the CompareIDs() method to compare a short-term id with a long-term one and get equality if they reference the same item. -- 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 "Nenad Dobrilovic" wrote in message ... Thank you for the detailed answer. I didn't give you all relevant information, sorry. Exchange Server was involved, and MailItem was saved after creating and moved to the external pst file later. The idea is to remember every EntryID of the MailItem that was created by an add-in, so that it can be treated differently later. Problem was that EntryID of the item opened by an Inspector was the short one, and not in the list of remembered ids, although it should be. Few lines of code where I was creating mail item we item.Save(); item.Move(some_folder); items_list.Add(item.EntryID); Folder 'some_folder' is inside of external non-default PST, so mail item gets new EntryID. I changed those lines to: item.Save(); item = (Outlook.MailItem)item.Move(some_folder); items_list.Add(item.EntryID); Now, item has a new EntryID, which can be found later. -- Nenad Dobrilovic |
#5
|
|||
|
|||
![]()
Would CompareIDs work when comparing old ID (when the item was in another store) with new ID (when item is moved to a different store)?
Ken Slovak - [MVP - Outlook] wrote: Don't forget that EntryID will change when an item is moved from one store to 03-Oct-08 Don't forget that EntryID will change when an item is moved from one store to another (mailbox to PST for example). If you were using a lower level API such as Extended MAPI, CDO 1.21 or Redemption (www.dimastr.com/redemption) you could use the CompareIDs() method to compare a short-term id with a long-term one and get equality if they reference the same item. -- 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 "Nenad Dobrilovic" wrote in message ... Previous Posts In This Thread: On Thursday, October 02, 2008 8:43 AM NenadDobrilovi wrote: Unknown Outlook MailItem EntryID My Outlook add-in handles NewInspector event of the Inspector object, in order to display a custom form for the mail item. I can get EntryID of the CurrentItem of the Inspector object which is passed as a parameter of the event. But, the problem is that the EntryID of the current mail item is shorter than it should be, and is unknown. I know every EntryID of every mail item that was created, and i can see that specific mail item has a wrong EntryID. What is wrong? -- Nenad Dobrilovic On Thursday, October 02, 2008 9:20 AM Ken Slovak - [MVP - Outlook] wrote: Does this involve Exchange server? Does this involve Exchange server? Exchange related stores (mailboxes and public folders) can supply 2 types of EntryID to you, short-term and long-term. The long-term id is permanent as long as the item is in the same store and folder, the short-term id is valid only for that Outlook session. When Outlook or another API compares 2 EntryID values using the MAPI CompareIDs method it accounts for both types of EntryID, so the comparison works even if short and long term id's are being compared. That won't work using a simple equality comparison. In MAPI terms if you get a MAPITable object of a folder's Items collection you can request both the short and long-term ids. If you get a null or empty value for the long-term id you then grab the short-term id. Again in MAPI terms, the property tag for the short-term id is PR_ENTRYID = 0x0FFF0102 and for the long-term id is PR_LONGTERM_ENTRYID_FROM_TABLE = 0x66700102. If you are using the Outlook object model then any methods that take the EntryID, such as NameSpace.GetItemFromID() will accept either of those id values and treat them as the same, and will return the same item no matter which id is used in the method call. -- 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 "Nenad Dobrilovic" wrote in message news ![]() On Thursday, October 02, 2008 10:25 AM NenadDobrilovi wrote: Thank you for the detailed answer. Thank you for the detailed answer. I didn't give you all relevant information, sorry. Exchange Server was involved, and MailItem was saved after creating and moved to the external pst file later. The idea is to remember every EntryID of the MailItem that was created by an add-in, so that it can be treated differently later. Problem was that EntryID of the item opened by an Inspector was the short one, and not in the list of remembered ids, although it should be. Few lines of code where I was creating mail item we item.Save(); item.Move(some_folder); items_list.Add(item.EntryID); Folder 'some_folder' is inside of external non-default PST, so mail item gets new EntryID. I changed those lines to: item.Save(); item = (Outlook.MailItem)item.Move(some_folder); items_list.Add(item.EntryID); Now, item has a new EntryID, which can be found later. -- Nenad Dobrilovic "Ken Slovak - [MVP - Outlook]" wrote: On Friday, October 03, 2008 8:52 AM Ken Slovak - [MVP - Outlook] wrote: Don't forget that EntryID will change when an item is moved from one store to Don't forget that EntryID will change when an item is moved from one store to another (mailbox to PST for example). If you were using a lower level API such as Extended MAPI, CDO 1.21 or Redemption (www.dimastr.com/redemption) you could use the CompareIDs() method to compare a short-term id with a long-term one and get equality if they reference the same item. -- 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 "Nenad Dobrilovic" wrote in message ... Submitted via EggHeadCafe - Software Developer Portal of Choice Putting Twitter Realtime Search to Work http://www.eggheadcafe.com/tutorials...-realtime.aspx |
#6
|
|||
|
|||
![]()
Would CompareIDs work when comparing old ID (when the item was in another store) with new ID (when item is moved to a different store)?
Ken Slovak - [MVP - Outlook] wrote: Don't forget that EntryID will change when an item is moved from one store to 03-Oct-08 Don't forget that EntryID will change when an item is moved from one store to another (mailbox to PST for example). If you were using a lower level API such as Extended MAPI, CDO 1.21 or Redemption (www.dimastr.com/redemption) you could use the CompareIDs() method to compare a short-term id with a long-term one and get equality if they reference the same item. -- 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 "Nenad Dobrilovic" wrote in message ... Previous Posts In This Thread: On Thursday, October 02, 2008 8:43 AM NenadDobrilovi wrote: Unknown Outlook MailItem EntryID My Outlook add-in handles NewInspector event of the Inspector object, in order to display a custom form for the mail item. I can get EntryID of the CurrentItem of the Inspector object which is passed as a parameter of the event. But, the problem is that the EntryID of the current mail item is shorter than it should be, and is unknown. I know every EntryID of every mail item that was created, and i can see that specific mail item has a wrong EntryID. What is wrong? -- Nenad Dobrilovic On Thursday, October 02, 2008 9:20 AM Ken Slovak - [MVP - Outlook] wrote: Does this involve Exchange server? Does this involve Exchange server? Exchange related stores (mailboxes and public folders) can supply 2 types of EntryID to you, short-term and long-term. The long-term id is permanent as long as the item is in the same store and folder, the short-term id is valid only for that Outlook session. When Outlook or another API compares 2 EntryID values using the MAPI CompareIDs method it accounts for both types of EntryID, so the comparison works even if short and long term id's are being compared. That won't work using a simple equality comparison. In MAPI terms if you get a MAPITable object of a folder's Items collection you can request both the short and long-term ids. If you get a null or empty value for the long-term id you then grab the short-term id. Again in MAPI terms, the property tag for the short-term id is PR_ENTRYID = 0x0FFF0102 and for the long-term id is PR_LONGTERM_ENTRYID_FROM_TABLE = 0x66700102. If you are using the Outlook object model then any methods that take the EntryID, such as NameSpace.GetItemFromID() will accept either of those id values and treat them as the same, and will return the same item no matter which id is used in the method call. -- 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 "Nenad Dobrilovic" wrote in message news ![]() On Thursday, October 02, 2008 10:25 AM NenadDobrilovi wrote: Thank you for the detailed answer. Thank you for the detailed answer. I didn't give you all relevant information, sorry. Exchange Server was involved, and MailItem was saved after creating and moved to the external pst file later. The idea is to remember every EntryID of the MailItem that was created by an add-in, so that it can be treated differently later. Problem was that EntryID of the item opened by an Inspector was the short one, and not in the list of remembered ids, although it should be. Few lines of code where I was creating mail item we item.Save(); item.Move(some_folder); items_list.Add(item.EntryID); Folder 'some_folder' is inside of external non-default PST, so mail item gets new EntryID. I changed those lines to: item.Save(); item = (Outlook.MailItem)item.Move(some_folder); items_list.Add(item.EntryID); Now, item has a new EntryID, which can be found later. -- Nenad Dobrilovic "Ken Slovak - [MVP - Outlook]" wrote: On Friday, October 03, 2008 8:52 AM Ken Slovak - [MVP - Outlook] wrote: Don't forget that EntryID will change when an item is moved from one store to Don't forget that EntryID will change when an item is moved from one store to another (mailbox to PST for example). If you were using a lower level API such as Extended MAPI, CDO 1.21 or Redemption (www.dimastr.com/redemption) you could use the CompareIDs() method to compare a short-term id with a long-term one and get equality if they reference the same item. -- 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 "Nenad Dobrilovic" wrote in message ... On Wednesday, February 10, 2010 4:18 PM Silas Peterson wrote: CompareIDs Would CompareIDs work when comparing old ID (when the item was in another store) with new ID (when item is moved to a different store)? Submitted via EggHeadCafe - Software Developer Portal of Choice Generic Feed Parsers Redux http://www.eggheadcafe.com/tutorials...sers-redu.aspx |
#7
|
|||
|
|||
![]()
Yes.
-- 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 Silas Peterson wrote in message ... Would CompareIDs work when comparing old ID (when the item was in another store) with new ID (when item is moved to a different store)? Ken Slovak - [MVP - Outlook] wrote: Don't forget that EntryID will change when an item is moved from one store to 03-Oct-08 Don't forget that EntryID will change when an item is moved from one store to another (mailbox to PST for example). If you were using a lower level API such as Extended MAPI, CDO 1.21 or Redemption (www.dimastr.com/redemption) you could use the CompareIDs() method to compare a short-term id with a long-term one and get equality if they reference the same item. -- 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 "Nenad Dobrilovic" wrote in message ... Previous Posts In This Thread: On Thursday, October 02, 2008 8:43 AM NenadDobrilovi wrote: Unknown Outlook MailItem EntryID My Outlook add-in handles NewInspector event of the Inspector object, in order to display a custom form for the mail item. I can get EntryID of the CurrentItem of the Inspector object which is passed as a parameter of the event. But, the problem is that the EntryID of the current mail item is shorter than it should be, and is unknown. I know every EntryID of every mail item that was created, and i can see that specific item has a wrong EntryID. What is wrong? -- Nenad Dobrilovic On Thursday, October 02, 2008 9:20 AM Ken Slovak - [MVP - Outlook] wrote: Does this involve Exchange server? Does this involve Exchange server? Exchange related stores (mailboxes and public folders) can supply 2 types of EntryID to you, short-term and long-term. The long-term id is permanent as long as the item is in the same store and folder, the short-term id is valid only for that Outlook session. When Outlook or another API compares 2 EntryID values using the MAPI CompareIDs method it accounts for both types of EntryID, so the comparison works even if short and long term id's are being compared. That won't work using a simple equality comparison. In MAPI terms if you get a MAPITable object of a folder's Items collection you can request both the short and long-term ids. If you get a null or empty value for the long-term id you then grab the short-term id. Again in MAPI terms, the property tag for the short-term id is PR_ENTRYID = 0x0FFF0102 and for the long-term id is PR_LONGTERM_ENTRYID_FROM_TABLE = 0x66700102. If you are using the Outlook object model then any methods that take the EntryID, such as NameSpace.GetItemFromID() will accept either of those id values and treat them as the same, and will return the same item no matter which id is used in the method call. -- 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 "Nenad Dobrilovic" wrote in message news ![]() On Thursday, October 02, 2008 10:25 AM NenadDobrilovi wrote: Thank you for the detailed answer. Thank you for the detailed answer. I didn't give you all relevant information, sorry. Exchange Server was involved, and MailItem was saved after creating and moved to the external pst file later. The idea is to remember every EntryID of the MailItem that was created by an add-in, so that it can be treated differently later. Problem was that EntryID of the item opened by an Inspector was the short one, and not in the list of remembered ids, although it should be. Few lines of code where I was creating mail item we item.Save(); item.Move(some_folder); items_list.Add(item.EntryID); Folder 'some_folder' is inside of external non-default PST, so mail item gets new EntryID. I changed those lines to: item.Save(); item = (Outlook.MailItem)item.Move(some_folder); items_list.Add(item.EntryID); Now, item has a new EntryID, which can be found later. -- Nenad Dobrilovic "Ken Slovak - [MVP - Outlook]" wrote: On Friday, October 03, 2008 8:52 AM Ken Slovak - [MVP - Outlook] wrote: Don't forget that EntryID will change when an item is moved from one store to Don't forget that EntryID will change when an item is moved from one store to another (mailbox to PST for example). If you were using a lower level API such as Extended MAPI, CDO 1.21 or Redemption (www.dimastr.com/redemption) you could use the CompareIDs() method to compare a short-term id with a long-term one and get equality if they reference the same item. -- 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 "Nenad Dobrilovic" wrote in message ... Submitted via EggHeadCafe - Software Developer Portal of Choice Putting Twitter Realtime Search to Work http://www.eggheadcafe.com/tutorials...-realtime.aspx |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem getting EntryID for attached e-mail in Outlook journal ite | Alex Ksendzov | Outlook and VBA | 11 | May 28th 08 02:33 AM |
Outlook Script:How to: Search base on EntryID ? | bbnimda | Outlook and VBA | 1 | December 3rd 07 04:20 PM |
Blank Outlook Contact Entries - Invalid ENTRYID was passed in... | Teejay | Outlook - Using Contacts | 0 | July 18th 06 07:37 PM |
Blank Outlook Contact Entries, Invalid ENTRYID was passed in error | Teejay | Outlook - Using Contacts | 0 | July 18th 06 07:35 PM |
How can I create a MailItem that displays like a received MailItem ? | Clive | Outlook - Using Forms | 0 | February 27th 06 04:14 PM |