![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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).Fol ders(1) Set myAddressLists = MyNameSpace.AddressLists("DE DAUW") Debug.Print Debug.Print "MyfolderPath:" & myNewFolder.FolderPath Debug.Print "Myfolder:" & MyFolder.Name, "MyNewFolder:" & myNewFolder.Name |
Ads |
#2
|
|||
|
|||
![]()
Look at the Namespace.GetSharedDefaultFolder method.
-- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Rudy" wrote in message ... 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).Fol ders(1) Set myAddressLists = MyNameSpace.AddressLists("DE DAUW") Debug.Print Debug.Print "MyfolderPath:" & myNewFolder.FolderPath Debug.Print "Myfolder:" & MyFolder.Name, "MyNewFolder:" & myNewFolder.Name |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Accessing .pst folder in outlook using VBA Code | Abhijat | Outlook and VBA | 4 | October 14th 09 05:10 PM |
Error accessing Outlook folder | John[_11_] | Outlook and VBA | 1 | December 27th 08 03:25 PM |
Error: Unable to display the folder. The Inbox folder cannot be found. - when accessing someone else's mailbox and having the proper rights | Spin[_2_] | Outlook - General Queries | 2 | December 19th 08 12:13 AM |
help accessing main store folder | brucegooglegroups | Outlook Express | 9 | June 8th 07 04:24 AM |
Accessing file folder | doughboy | Outlook - Installation | 0 | January 25th 06 11:03 PM |