Outlook - Pull contact from Outlook into Excel

R

Rubble

Hi --

Wondering what the command line is to pull up the Select Name:Contacts
dialogue box in Outlook is from Excel -

What I am trying to do is to make it so I can have a user select a contact
from the select name dialogue box while in Excel and then dump the contact
info into Excel once they have selected a contact.

Thank you in advance --
 
A

Alan Moseley

You will need to add CDO 1.21 to your list of references. The following
code shows the Select Names box, allows you to select a recipient, and do
something with it:-

Dim objSession As New MAPI.Session
Dim objRecips As MAPI.Recipients
Dim objRecip As MAPI.Recipient
objSession.Logon , , False, False
Set objRecips = objSession.AddressBook(, "Select Name", True, _
False, 1, "Recipients")
Set objRecip = objRecips.Item(1)
MsgBox objRecip.Name
Set objRecip = Nothing
Set objRecips = Nothing
objSession.Logoff
Set objSession = Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top