Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / July 2006

Tip: Looking for answers? Try searching our database.

How to use "Look up Outlook Contact" function with code? VSTO 2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Webb - 28 Jul 2006 17:26 GMT
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?
Signature

David Webb

Ken Slovak - [MVP - Outlook] - 28 Jul 2006 19:29 GMT
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.

Signature

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

> 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
[quoted text clipped - 24 lines]
> comparing
> email addresses the only way?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.