none
How to launch the Outlook global address book dialog box from excel by VBA RRS feed

  • Question

  • Dear all

             Would you tell me how to launch the Outlook address book from excel by using VBA code? 

             And then copy the select contact info to the chosen cell.

       I found some articles says I could use the Collaboration Data Objects (CDO) to finish this task. But the CDO is no longer available in Outlook 2010 and later versions.

       So. Could you show me how to carry out that task?      Sorry for my poor English..........

    Thanks in advance!!         

    Sunday, May 12, 2013 3:31 PM

Answers

All replies

  • Hello,

    Thanks for your participation. According to your description, I will move this thread to Outlook for Developers forum for better support, because this issue is mainly dealing with Outlook object modals, your understanding will be appreciated.

    Regards,


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 15, 2013 8:01 AM
    Moderator
  • Use SelectNamesDialog.Display.

    SelectNamesDialog object can be retrieved from Application.Session.GetSelectNamesDialog.

    Keep in mind that if you call SelectNamesDialog.Display from Excel, Outlook will be brought to the foreground. To avoid that, you will need either CDO 1.21 or Redemption (use RDOSession.AddressBook.ShowAddressBook) - they both run in-proc, and Redemption allows to specify the parent window to be used as the parent of the address book dialog.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!


    Wednesday, May 15, 2013 3:21 PM
  • Thank you~! Dmitry

    Your answer is very important!!

    SelectNamesDialog is just what i want! 

    Could you please tell me how to get the Contact Item information(each as Name, Email Address, and so on) from SelectNamesDialog by double click it. Then write the information into the Excel chosen cells.




    Keep Doing


    • Edited by cjwn Tuesday, May 21, 2013 7:32 AM
    Tuesday, May 21, 2013 7:24 AM
  • You will get back the Recipients collection with the selected entries. Use Recipient.AddressEntry to access various properties. If a particular MAPI property is not explicitly exposed, you can access it using RDOAddressEntry.Fields[].

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, July 2, 2013 4:00 AM