Become a Columnist Microsoft Exchange Site Microsoft Support SiteMSDN Exchange Site

       How did you like this article? Please vote and let us know.          

Subscribe to OutlookExchange
Anderson Patricio
Ann Mc Donough
Bob Spurzem
Brian Veal
Catherine Creary
Cherry Beado
Colin Janssen
Collins Timothy Mutesaria
Drew Nicholson
Fred Volking
Glen Scales
Goran Husman
Guy Thomas
Henrik Walther
Jason Sherry
Jayme Bowers
John Young
Joyce Tang
Justin Braun
Konstantin Zheludev
Kristina Waters
Kuang Zhang
Mahmoud Magdy
Martin Tuip
Michael Dong
Michele Deo
Mitch Tulloch
Nicolas Blank
Pavel Nagaev
Ragnar Harper
Ricardo Silva
Richard Wakeman
Russ Iuliano
Santhosh Hanumanthappa
Shannal L. Thomas
Steve Bryant
Steve Craig
Todd Walker
Tracey J. Rosenblath

 

 
 

Resolving an eMail name in Contacts programatically

This code provides a method for resolving the Contact eMail name through programming. The key line is the Set Command line. The workaround displays the form, but it is an acceptable way to overcome this limitation. A KB article should be forthcoming on this.

Sub ResolveContactAddress()
Dim ol As Outlook.Application
Dim olns As NameSpace
Dim myContact As Object
Dim Command As Object
Dim myMailItem As Object
Dim myRecipient As Object
Set ol = New Outlook.Application
Set olns = ol.GetNamespace("MAPI")
Set myContact = olns.GetDefaultFolder(olFolderContacts).Items.Add
With myContact
.FullName = "John Smith"
.Email1Address = "jsmith@msn.com"
.Email1AddressType = "SMTP"
.Display
End With
Set Command = ol.ActiveInspector.CommandBars("Tools").Controls("Check
Names")
Command.Execute
myContact.Close 0
End Sub


Disclaimer: Your use of the information contained in these pages is at your sole risk. All information on these pages is provided "as is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by Pro Exchange. OutlookExchange.Com and Pro Exchange shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.

© Copyright Pro Exchange, Inc., 2006