A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

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



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 28th 06, 05:26 PM posted to microsoft.public.outlook.program_vba
David Webb
external usenet poster
 
Posts: 1
Default How to use "Look up Outlook Contact" function with code? VSTO 2005

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  
Old July 28th 06, 07:29 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to use "Look up Outlook Contact" function with code? VSTO 2005

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 10:36 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.