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
 
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 Using Outlook 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
S Problem Accessing .MSG Property 'ImageNaturalHeight' Tag '0x80010003' Outlook VBA and Custom Forms 1
M Accessing ALL Outlook contact fields Outlook VBA and Custom Forms 3
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 Search Folders and Jump to Folder Outlook VBA and Custom Forms 2
X Run macro automatically when a mail appears in the sent folder Using Outlook 5
P Can't add custom field to custom Outlook form, it always adds to the Folder instead Outlook VBA and Custom Forms 2
P Yahoo/IMAP folder rename by Outlook desktop 365 Using Outlook 0
A Outlook 2019 folder counter Using Outlook 0
A Search folder and move the email Outlook VBA and Custom Forms 0
N Reply to Outlook messages by moving messages to a specific Outlook folder Outlook VBA and Custom Forms 1
T How to find or display the sub-folder name for an Archive Search Using Outlook 10
A Outlook 365 (OutLook For Mac)Move "On My Computer" Folder Items From Old To New Mac Computer Using Outlook 3
P Search folder: all emails sent to or from a domain Using Outlook 1
V Folder Properties - Gmail account can't switch Using Outlook 5
Victor_50 Outlook 2019 Jump to folder from search folder Outlook VBA and Custom Forms 0
HarvMan Outlook 365 - Rule to Move an Incoming Message to Another Folder Using Outlook 4
S Email Macros to go to a SHARED Outlook mailbox Draft folder...NOT my personal Outlook Draft folder Using Outlook 2
I Help with Smart Folder + Query Builder on IMAP Using Outlook 0
S Paperclip icon shows without attachment in email under Sent folder Using Outlook 0

Similar threads

Back
Top