Accessing folder 'Other Contacts'

Status
Not open for further replies.
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
 
D

Dmitry Streblechenko

Look at the Namespace.GetSharedDefaultFolder method.

Dmitry Streblechenko (MVP)

-

"Rudy" <Rudy> wrote in message

news:8AED479E-22F6-44A3-A695-77107E1DA0CC@microsoft.com...
> 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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
E Accessing shared outlook folder doesn't work since switch to new outlook/excel Outlook VBA and Custom Forms 11
C Problem accessing events for folder "username" Server Threw Exception Calendar Printing Assistant 1
A "Unable to display the folder" error when accessing Group mailbox Using Outlook 0
A Accessing .pst folder in outlook using VBA Code Outlook VBA and Custom Forms 4
RBLampert Accessing Outlook accounts from multiple computers Using Outlook 8
J Accessing calendar items for Resource Mailboxes Outlook VBA and Custom Forms 2
S Outlook [Online - Office365] perfomance is getting affected when accessing the mails using Redemptio Using Outlook 1
J Accessing Hotmail accounts with Outlook 2016 Using Outlook 3
n2b Accessing Plain Text Draft Without Outlook Using Outlook 3
G Issues with accessing Outlook Contact Picture with VBA Outlook VBA and Custom Forms 4
M Accessing ExpiryTime property Outlook VBA and Custom Forms 1
M Accessing BCM with Excel / Running Reports BCM (Business Contact Manager) 1
P accessing custom task pane with Outlook ActiveInspector Using Outlook 1
mikecox Accessing Outlook on my Win7 desktop from Win8 laptop Using Outlook 1
Commodore Accessing mail from multiple devices Using Outlook 1
S Programmatically accessing Outlook Calendar data Using Outlook 1
E Accessing User Defined Fields in BCM Database part 2 BCM (Business Contact Manager) 0
E [SOLVED] Accessing User Defined Fields in BCM Database part 1 BCM (Business Contact Manager) 9
E Accessing a Form Region from an Inspector Outlook VBA and Custom Forms 3
E Accessing a Form Region from an Inspector Outlook VBA and Custom Forms 3
D Accessing Global Address List details with VBA Outlook VBA and Custom Forms 1
H Accessing a control on a frame in Outlook with VBScript Outlook VBA and Custom Forms 1
K Programmatically accessing Outlook properties Outlook VBA and Custom Forms 3
K assistant accessing from her home computer BCM (Business Contact Manager) 2
J Outlook closes when accessing History in BCM BCM (Business Contact Manager) 4
B Accessing Outlook 2003 Signature Programmatically using C# Outlook VBA and Custom Forms 6
L Outlook Forms-Accessing Outlook VBA and Custom Forms 1
C Accessing _RecipientControl1 (Assigned To) Outlook VBA and Custom Forms 2
K Accessing contact's custom properties in a Outlook 2007 form region Outlook VBA and Custom Forms 1
V Outlook custom form - installing and accessing Outlook VBA and Custom Forms 1
A Daily hours of recurring/ multi-day appts, & accessing mult calend Outlook VBA and Custom Forms 2
R New users creating get page cannot be displayed when accessing OWA Exchange Server Administration 16
G Retention Policy for Outlook.com Deleted Items folder Using Outlook 0
Z Outlook 365 delete reminder you can’t make change to contents of this-read only folder Using Outlook 4
O The Outlook API wrongfully shows an outlook folder to have zero sub-folders Outlook VBA and Custom Forms 1
O The Outlook API wrongfully shows an outlook folder to have zero sub-folders Outlook VBA and Custom Forms 2
S Outlook (2016 32bit; Gmail IMAP) - Save sent message to Outllook Folder Outlook VBA and Custom Forms 0
D Move Email with Attachment to Folder Outlook VBA and Custom Forms 3
C VBA to prompt for Sent folder destination Outlook VBA and Custom Forms 3
G How to add a folder shortcut to outlook quick access toolbar? Using Outlook 6
G Add to Outlook Contacts - Point to non-default contacts folder Using Outlook 0
M Move to Folder Using Outlook 1
K Export Folder to PST Outlook VBA and Custom Forms 2
B Spam folder not showing in Outlook Using Outlook 5
D Is a sub folder under contacts necessary to be able to name an Address Book? Using Outlook 1
J Moved many emails to Outlook external folder, need to delete on Gmail server Using Outlook 14
A Going to folder using shortcuts Using Outlook 3
B Outlook 2016 Auto-archive creates new folder Using Outlook 3
B BCC issues after changing root folder path for gmail Using Outlook 1
Fozzie Bear Outlook 2016 Creating a shared local Contacts folder Using Outlook 2

Similar threads

Top