Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re:Opening Outlook Address Book from Access 1

Status
Not open for further replies.

abhi1024

Programmer
Dec 20, 2003
55
US
Hi,
I am trying to open Outlook Address Book from Access using some VBA code.I am able to display each member's name in a Message Box but just not able to open the Address Book to allow users to select a user and shoot an email.
Following is the code that I am using

Any suggestions/help
Thanks,
Abhishek


Public Function GetAddressList()

Dim myOlApp As Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myAddressList As Outlook.AddressList

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")

'Set myAddressList to the Global Address List within the AddressLists collection.
Set myAddressList = myNameSpace.AddressLists("Global Address List")


For Each memberentry In myAddressList.AddressEntries
MsgBox memberentry
Next
End Function
 
THis question has been around a while but I just came across it when lookng for something else.

If you just want the names you can link to the Outlook table and use the Outlook contacts and email addresses as if they were in an access table.

To link to the table:
In Access select Files - get External Data - Link Tables
In 'Files of Type' select OUtlook.
Select Contacts.

This links your Access App to your Outlook file. you do not need to open the Address book.


HTH

Rich

Bespoke and off-the-shelf Access solutions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top