![]() |
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
|
|||
|
|||
![]()
In Outlook 2003, if you open a message and hover over the name in the From
field, a menu appears with "Look up Outlook Contact" as one of the menu items which will either open up a Contact or display a message stating that no matching contact was found. I would like to be able to use code in my VSTO 2005 Add-In to open a message and check to see if there is a matching Contact. If so, I want to set some of the UserProperties of the Contact Item. Currently, I am searching for a string in the Subject of the Inbox items and when one is found, I then loop through all of the Contacts to find a matching email address. This seems to me to be the slow way of doing it although it does work. It would probably be much faster to be able to open up a Contact item using code the same way that a user can open up a Contact item by using the "Look up Outlook Contact" function. Is this possible or is looping through the Contacts collection and comparing email addresses the only way? -- David Webb |
#2
|
|||
|
|||
![]()
One way or the other you're going to be comparing email addresses. How
quickly that goes depends on how you do that. If using the Outlook object model probably the quickest way is to use a Restriction on the Items collection of each contacts folder, restricting first on Email1Address then on Email2Address then on Email3Address. Once you have that contact item getting its EntryID and an object reference to the contact and then displaying it is easy. A much quicker way would be to use a lower level API such as Extended MAPI (which is what Outlook does but it can only be programmed using C++ or Delphi) or something like Redemption (an Extended MAPI wrapper) and using a filtered MAPITable. That would be anywhere from 10 to 100 times faster than using the Outlook object model. -- 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 "David Webb" wrote in message ... In Outlook 2003, if you open a message and hover over the name in the From field, a menu appears with "Look up Outlook Contact" as one of the menu items which will either open up a Contact or display a message stating that no matching contact was found. I would like to be able to use code in my VSTO 2005 Add-In to open a message and check to see if there is a matching Contact. If so, I want to set some of the UserProperties of the Contact Item. Currently, I am searching for a string in the Subject of the Inbox items and when one is found, I then loop through all of the Contacts to find a matching email address. This seems to me to be the slow way of doing it although it does work. It would probably be much faster to be able to open up a Contact item using code the same way that a user can open up a Contact item by using the "Look up Outlook Contact" function. Is this possible or is looping through the Contacts collection and comparing email addresses the only way? -- David Webb |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Choose Contact" versus "Check Name" Dialog Box | Jason | Outlook - Using Contacts | 5 | July 12th 06 07:33 PM |
Explain Journal entry vs. "Notes" section on Contact "Box" | Charles Dice | Outlook - Using Contacts | 1 | July 11th 06 03:50 PM |
Is it possible to open the default Contact form with the Activities tab activated from a custom form? VSTO 2005, Outlook 2003 | David Webb | Outlook and VBA | 1 | June 20th 06 09:59 PM |
Allow "Contacts" button on the "Forward To" function in Outlook | microwave | Outlook - Using Contacts | 1 | April 20th 06 03:31 PM |
Undocumented Function? How to know for an olMailItem if it has been "replied" or "forwarded" | 9online | Outlook and VBA | 1 | February 15th 06 03:39 PM |