How to make a new Contacts Folders Contacts appear in Address Book

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using vb6 and Outlook 2000, created a new contact folder, added contacts
but cannot work out how to set the folder so that the contacts appear in the
address book. I know how to do this using outlook GUI, but need to do it
programmatically in code!
 
Hi Dmitry Streblechenko

There is no such property in Outlook 9 DLL for the MAPIFolder class. So that
does not work. Or maybe I am not instantiating it properly, can you give me
some simple example code?

Here is my code, the folder is created under the default olContactsFolder:

Dim ol As New Outlook.Application
Dim olns As Outlook.NameSpace
Dim cf As Outlook.MAPIFolder
Dim c As Outlook.ContactItem
Dim Prop As Outlook.UserProperty

Dim oAB As Outlook.AddressList
Dim oMyEntries As Outlook.AddressEntries


Dim fldPMS As Outlook.MAPIFolder

Set olns = ol.GetNamespace("MAPI")

Set cf = olns.GetDefaultFolder(olFolderContacts)

Set fldPMS = cf.Folders("PMS")

fldPMS.ShowAsOutlookAB = True ' This will not work as it is not in the
class
 
The property is available in Outlook 2002 and up only. To do that in Outlook
2000, you'd need to use Extended MAPI (C++ or Delphi only).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top