ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Outlook - Pull contact from Outlook into Excel (https://www.excelbanter.com/excel-programming/419813-outlook-pull-contact-outlook-into-excel.html)

Rubble

Outlook - Pull contact from Outlook into Excel
 
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 --


Alan Moseley

Outlook - Pull contact from Outlook into Excel
 
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

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"Rubble" wrote:

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



All times are GMT +1. The time now is 11:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com