Accessing folder 'Other Contacts'

R

Rudy

I am programming in VBA

Several users are using Outlook in a network environment. Each of them hat
its own 'Contacts'. They have shared their addresslists so that I can lookup
en change the contacts fields from my workstation.

I would like to access these Contactlists by using VBA. Therefor, i found
via the help function some code and tried to open the contact of a user
called 'DE DAUW' and whose contacts I can see in the 'Other Contacts'.
Impossible to get into the 'DE DAUW' addresslist.

Who can help me ?

Dim MyApp As Outlook.Application
Dim MyNameSpace As Outlook.Namespace
Dim MyFolder As Outlook.MAPIFolder
Dim MyItemsCollection As Object
Dim myItem As Object
Dim MyMatchingItem As Object
Dim myNewFolder As Outlook.MAPIFolder
Dim myAddressLists As AddressLists
Dim myAddressList As AddressList

Set MyApp = CreateObject("Outlook.Application")
Set MyNameSpace = MyApp.GetNamespace("MAPI")
MyNameSpace.Logon

Set MyFolder = MyNameSpace.GetDefaultFolder(olFolderContacts)
Set myNewFolder =
MyNameSpace.GetDefaultFolder(olFolderContacts).Folders(1)
Set myAddressLists = MyNameSpace.AddressLists("DE DAUW")

Debug.Print
Debug.Print "MyfolderPath:" & myNewFolder.FolderPath
Debug.Print "Myfolder:" & MyFolder.Name, "MyNewFolder:" & myNewFolder.Name
 

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