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 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
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
O Cannot expand the folder. The set of folders cannot be opened. You do not have permission to log on. Using Outlook 1
F Jump to Inbox folder when click on Favorite Using Outlook 8
P Print attachments automatically and move the mail to an existing folder called "Ted" Outlook VBA and Custom Forms 4
lcarpay Stay in the mail folder pane after ctrl-1 Using Outlook 1
T Macro to move reply and original message to folder Outlook VBA and Custom Forms 6
F VBA to move email from Non Default folder to Sub folders as per details given in excel file Outlook VBA and Custom Forms 11
G VBA to save selected Outlook msg with new name in selected network Windows folder Outlook VBA and Custom Forms 1
P Posts in Folder No Longer Group by Conversation Column After Search Using Outlook 0
Y Filter unread emails in a search folder vba help Outlook VBA and Custom Forms 0
Horsepower Moving emails between folder Outlook for Mac Outlook Wishlist 8
N contact list seen in Contact folder but knot in Address book or when 'TO' button is clicked in new email Using Outlook 0
D How to remove a folder, option grayed out Using Outlook 4
D How To Combine Share Task Folders in just one Folder Using Outlook 0
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

Similar threads

Top