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
S Problem Accessing .MSG Property 'ImageNaturalHeight' Tag '0x80010003' Outlook VBA and Custom Forms 0
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
K vba code to auto download email into a specific folder in local hard disk as and when any new email arrives in Inbox/subfolder Outlook VBA and Custom Forms 0
Z Outlook 365 Automatically assign categories to incoming mail in a shared folder Round Robin Outlook VBA and Custom Forms 1
G Adding a contact to a specific folder Using Outlook 0
Witzker Outlook 2019 Macro GoTo user defined search folder Outlook VBA and Custom Forms 7
Rupert Dragwater Duplicate email in Folder Using Outlook 8
S Adding a recipient's column to Sent folder in Outlook 2010 Outlook VBA and Custom Forms 1
L "Insert Pictures" Button-Wrong Folder Using Outlook 5
C Outlook 365 Copy/Save Emails in Folder Outside Outlook to Show Date Sender Recipient Subject in Header Using Outlook 0
Christopher M Outlook 365 Hey Diane! MS 365 Biz Standard and "Potential Spam" addressed to others coming to my JUNK folder? Using Outlook 2
J Quick steps delete original email and move reply/sent email to folder Using Outlook 2
A manual rule sends mail to wrong folder Using Outlook 5
richardwing Auto forward email that is moves into a specific outlook folder Outlook VBA and Custom Forms 5
D This folder up to date vs all folders up to date Using Outlook 1
G Automatically delete messages in the synchronization folder Outlook VBA and Custom Forms 4
wayneame Changing the Form Used by Existing Task Items in a Folder Outlook VBA and Custom Forms 4
S Need code to allow defined starting folder and selection from there to drill down Outlook VBA and Custom Forms 10

Similar threads

Top