Article ID: 169750
Article Last Modified on 2/12/2007
Sub ResolveContactAddressViaCheckNames()
Dim ol As Outlook.Application
Dim olns As NameSpace
Dim myContact As Object
Dim Menu as Object
Dim Command As Object
Set ol = New Outlook.Application
Set olns = ol.GetNamespace("MAPI")
' Create a new Contact item
Set myContact = olns.GetDefaultFolder(olFolderContacts).Items.Add
With myContact
' Set the relevant fields for the contact
.FullName = "John Smith"
.Email1Address = "jsmith@msn.com"
.Email1AddressType = "SMTP"
' Display the contact (required)
.Display
End With
' Set the Tools menu on the item's menu bar
Set Menu = ol.ActiveInspector.CommandBars("Tools")
' Sets the command on the menu
Set Command = Menu.Controls("Check Names")
' Actually executes the Check Names command
Command.Execute
End Sub
166368 OL97: How to Get Help Programming with Outlook
170783 OL97: Q&A: Questions about Customizing or Programming Outlook
Additional query words: OutSol OutSol97
Keywords: kbcode kbhowto kbprogramming KB169750