Windows Contact Schema Overview

This topic defines how the contact schema is used to read and write contact properties using IContactProperties.

New applications should not use these interfaces. These interfaces exist for backward compatibility with legacy applications. These interfaces will be unavailable in the future.

This topic contains the following sections:

Contact Property Categories

Contact properties fit into one of two categories:

  • Single-value: This property type has a single value for any contact. Birthdays are an example; a contact has only one birthday.
  • Hierarchical: This property type has multiple values for any contact and require labeling to differentiate individual values. A phone number is an example; a contact can have one or more phone numbers (home, work, and mobile phone).

Contact Property Extensibility

Applications that use contacts may want contact data that the application-supplied schema does not provide. IContactProperties supports two approaches to extend the base contact schema:

  • Using Labels: For hierarchical properties, application-supplied contact array nodes can be differentiated by applying labels (arbitrary strings) to each node. For example, a phone number can be labeled with Voice or Pager. You can create custom labels or use one from the base schema. See Standard Labels for Contact Properties below.
    Custom labels must be created in the form of Uniform Resource Identifiers (URIs). For more information, see Adding your own Label to a Property for a code example that uses IContactProperties to set a unique label on an existing property. IContactProperties also provides methods to manipulate labels and to filter data to obtain a desired IContactPropertyCollection.
  • Contacts API programming: For single-value and hierarchical properties, an outside application can define new contact properties and array nodes (see IContactProperties::CreateArrayNode). The data contained in these new properties can be enumerated by IContactProperties from other applications. For an example of this, see Adding your own Property to a Contact.
    Note  Developers must prefix a unique namespace (in brackets) to these new contact properties to avoid conflicts.

Windows Contact Schema Element Definitions

The following elements are defined for the base schema:

Single-Value Properties

PropertyValueDescription
CONTACTPROP_PUB_GENDERL"Gender"Choose one of L"Male", L"Female", L"Unspecified" (default)
CONTACTPROP_PUB_NOTESL"Notes"Free text content in which to write notes
CONTACTPROP_PUB_MAILERL"Mailer"The contact's e-mail program
CONTACTPROP_PUB_PROGIDL"ProgID"The ProgID of mailer
CONTACTPROP_PUB_CREATIONDATEL"CreationDate"The date and time the contact was created in the system

Hierarchical Properties

These properties contain many values differentiated by labels. To access the heirarchical properties through IContactProperties::GetString, IContactProperties::GetDate, and IContactProperties::GetBinary you need to provide an index (1 based). For example, a parameter in the form of L"NameCollection/Name[1]/Title" returns the Title string of the first Name property in the contact.

PropertyValueDescription
CONTACTPROP_PUB_L1_CONTACTIDSL"ContactIDCollection"A collection of ContactIDs associated with this contact
CONTACTPROP_PUB_L2_CONTACTIDL"/ContactID"An entry in the collection of IDs
CONTACTPROP_PUB_L3_VALUEL"/Value"One of the unique identifiers for this contact (as a string)
CONTACTPROP_PUB_L1_NAMECOLLECTIONL"NameCollection"A collection of names associated with this contact
CONTACTPROP_PUB_L2_NAMEL"/Name"An entry in the collection of names
CONTACTPROP_PUB_L3_FORMATTEDNAMEL"/FormattedName"The name as displayed, such as "John H. Smith III"
CONTACTPROP_PUB_L3_PHONETICL"/Phonetic""Name as pronounced
CONTACTPROP_PUB_L3_PREFIXL"/Prefix""A prefix to the contact name, such as "Ms."
CONTACTPROP_PUB_L3_TITLEL"/Title"A person's title, such as "Dr."
CONTACTPROP_PUB_L3_GIVENNAMEL"/GivenName"A person's first name
CONTACTPROP_PUB_L3_FAMILYNAMEL"/FamilyName"A person's last name
CONTACTPROP_PUB_L3_MIDDLENAMEL"/MiddleName"A person's middle name
CONTACTPROP_PUB_L3_GENERATIONL"/Generation"A person's family name generation, such as "III" or "Jr."
CONTACTPROP_PUB_L3_SUFFIXL"/Suffix"A person's credentials, such as "PhD"
CONTACTPROP_PUB_L3_NICKNAMEL"/NickName"A person's nickname, such as "Ace"
CONTACTPROP_PUB_L1_POSITIONCOLLECTIONL"PositionCollection"Collection of positions that a contact holds
CONTACTPROP_PUB_L2_POSITIONL"/Position"An entry in the collection of names
CONTACTPROP_PUB_L3_ORGANIZATIONL"/Organization"The contact's organization, such as "IEEE"
CONTACTPROP_PUB_L3_COMPANYL"/Company"The contact's company, such as "Microsoft"
CONTACTPROP_PUB_L3_DEPARTMENTL"/Department"The department, such as "Accounting"
CONTACTPROP_PUB_L3_OFFICEL"/Office"The office number, such as "10/1234"
CONTACTPROP_PUB_L3_JOB_TITLEL"/JobTitle"Any job title, such as "Software Engineer"
CONTACTPROP_PUB_L3_PROFESSIONL"/Profession"The line of work, such as "Plumber"
CONTACTPROP_PUB_L3_ROLEL"/Role"The role in the organization, such as "Quality Assurance"
CONTACTPROP_PUB_L1_PERSONCOLLECTIONL"PersonCollection"Collection of people associated with the contact
CONTACTPROP_PUB_L2_PERSONL"/Person"Entry in the collection
CONTACTPROP_PUB_L3_FORMATTEDNAMEL"/FormattedName"The person's formatted (display) name
CONTACTPROP_PUB_L3_PERSONIDL"/PersonID"Unique ID for this person, which may be a ContactID from another IContact entry
CONTACTPROP_PUB_L1_DATECOLLECTIONL"DateCollection"Collection of dates associated with the contact
CONTACTPROP_PUB_L2_DATEL"/Date"Entry in the collection
CONTACTPROP_PUB_L3_VALUEL"/Value"Value for this date, as a DateTime
CONTACTPROP_PUB_L1_EMAILADDRESSCOLLECTIONL"EmailAddressCollection"Collection of email addresses
CONTACTPROP_PUB_L2_EMAILADDRESSL"/EmailAddress"Entry in the collection
CONTACTPROP_PUB_L3_ADDRESSL"/Address"The address, such as example@microsoft.com
CONTACTPROP_PUB_L3_TYPEL"/Type"Type of address (for example, SMTP or x509)
CONTACTPROP_PUB_L1_CERTIFICATECOLLECTIONL"CertificateCollection"Collection of certificate data and thumbprints
CONTACTPROP_PUB_L2_CERTIFICATEL"/Certificate"Entry in the collection
CONTACTPROP_PUB_L3_VALUEL"/Value"Certificate value
CONTACTPROP_PUB_L3_THUMBPRINTL"/ThumbPrint"Thumbprint value
CONTACTPROP_PUB_L1_PHONENUMBERCOLLECTIONL"PhoneNumberCollection"Collection of phone numbers
CONTACTPROP_PUB_L2_PHONENUMBERL"/PhoneNumber"Entry in the collection
CONTACTPROP_PUB_L3_NUMBERL"/Number"Normal number to display (as string)
CONTACTPROP_PUB_L3_ALTERNATEL"/Alternate"Alternate number (as string)
CONTACTPROP_PUB_L1_PHYSICALADDRESSCOLLECTIONL"PhysicalAddressCollection"Collection of physical addresses
CONTACTPROP_PUB_L2_PHYSICALADDRESSL"/PhysicalAddress"Entry in the collection
CONTACTPROP_PUB_L3_ADDRESSLABELL"/AddressLabel"The exact data that a mailing label contains
CONTACTPROP_PUB_L3_STREETL"/Street"Number and street
CONTACTPROP_PUB_L3_LOCALITYL"/Locality"City or urban district
CONTACTPROP_PUB_L3_REGIONL"/Region"State or Province
CONTACTPROP_PUB_L3_POSTALCODEL"/PostalCode"Zip or PostalCode
CONTACTPROP_PUB_L3_COUNTRYL"/Country"The country, territory, or nation
CONTACTPROP_PUB_L3_POBOXL"/POBox"Any POBox number
CONTACTPROP_PUB_L3_EXTENDEDADDRESSL"/ExtendedAddress"Any extra information
CONTACTPROP_PUB_L1_IMADDRESSCOLLECTIONL"IMAddressCollection"Instant Messaging Service (IM) addresses and protocols
CONTACTPROP_PUB_L2_IMADDRESSENTRYL"/IMAddress"Entry in the collection
CONTACTPROP_PUB_L3_VALUEL"/Value"The identifing data (for example, username@microsoft.com)
CONTACTPROP_PUB_L3_PROTOCOLL"/Protocol"The protocol as a string (for example, Messenger Protocol)
CONTACTPROP_PUB_L1_URLCOLLECTIONL"UrlCollection"Collection of URLs associated with this contact
CONTACTPROP_PUB_L2_URLL"/Url"An entry in the collection of url
CONTACTPROP_PUB_L3_VALUEL"/Value"The actual URL data (as a string)
CONTACTPROP_PUB_L1_PHOTOCOLLECTIONL"PhotoCollection"Collection of images associated with this contact
CONTACTPROP_PUB_L2_PHOTOL"/Photo"An entry in the collection of photos
CONTACTPROP_PUB_L3_VALUEL"/Value"Image that represents the contact (binary with MIME type)
CONTACTPROP_PUB_L3_URLL"/Url"A URL for retrieving the image (as a string)

Standard Labels for Contact Properties

These labels differentiate second level (L2) entries. For example, a company address is created by labelling a CONTACTPROP_PUB_L2_PHYSICALADDRESS property as Business.

Common Contact Labels

LabelValueDescription
CONTACTLABEL_PUB_PREFERREDL"Preferred"Note: many entries in a set may have this "Preferred" label set.
CONTACTLABEL_PUB_PERSONALL"Personal"Home-related data
CONTACTLABEL_PUB_BUSINESSL"Business"Work-related data
CONTACTLABEL_PUB_OTHERL"Other"Some other label (but not a URI substitute for a label)

PhoneNumber Labels

The following labels can be associated with PhoneNumber elements.

LabelValueDescription
CONTACTLABEL_PUB_VOICEL"Voice"A number that supports voice conversation
CONTACTLABEL_PUB_MOBILEL"Mobile"A mobile phone number
CONTACTLABEL_PUB_PCSL"PCS"PCS support
CONTACTLABEL_PUB_CELLULARL"Cellular"A cell phone support
CONTACTLABEL_PUB_CARL"Car"A number for travel
CONTACTLABEL_PUB_PAGERL"Pager"A pager number
CONTACTLABEL_PUB_TTYL"TTY"A tty machine
CONTACTLABEL_PUB_FAXL"Fax"A fax machine number
CONTACTLABEL_PUB_VIDEOL"Video"number supports video conversation
CONTACTLABEL_PUB_MODEML"Modem"A number for modem connection
CONTACTLABEL_PUB_BBSL"BBS"A number for BBS connection
CONTACTLABEL_PUB_ISDNL"ISDN"A number for ISDN

Person Labels

The following labels can be associated with Person elements. Some of these labels are specific to the Microsoft Windows Address Book (WAB).

LabelValueDescription
CONTACTLABEL_PUB_AGENTL"Agent"This person is allowed to work on behalf of the contact
CONTACTLABEL_WAB_SPOUSEL"wab:Spouse"The contact's spouse
CONTACTLABEL_WAB_CHILDL"wab:Child"A child of the contact
CONTACTLABEL_WAB_MANAGERL"wab:Manager"The contact's manager
CONTACTLABEL_WAB_ASSISTANTL"wab:Assistant"The contact's personal assistant

PhysicalAddress Labels

The following labels can be associated with PhysicalAddress elements.

LabelValueDescription
CONTACTLABEL_PUB_DOMESTICL"Domestic"A domestic mailing address
CONTACTLABEL_PUB_INTERNATIONALL"International"An international mailing address
CONTACTLABEL_PUB_POSTALL"Postal"A mailing address which accepts incoming mail
CONTACTLABEL_PUB_PARCELL"Parcel"A mailing address that accepts packages

Photo Labels

The following labels can be associated with Photo elements.

LabelValueDescription
CONTACTLABEL_PUB_USERTILEL"UserTile"An image used to represent the contact
CONTACTLABEL_PUB_LOGOL"Logo"A logo (for example, to represent the contact's organization)

Date Labels

The following labels can be associated with Date elements. These labels are specific to WAB.

LabelValueDescription
CONTACTLABEL_WAB_BIRTHDAYL"wab:Birthday"The contact's birth date
CONTACTLABEL_WAB_ANNIVERSARYL"wab:Anniversary"A date of an important event

Url Labels

The following labels can be associated with Url elements. These labels are specific to WAB.

LabelValueDescription
CONTACTLABEL_WAB_SOCIALNETWORKL"wab:SocialNetwork"A link to an online community
CONTACTLABEL_WAB_SCHOOLL"wab:School"The site of an educational institution
CONTACTLABEL_WAB_WISHLISTL"wab:WishList"A page of bookmarked items
Tags :


Community Content

DSC_KE_MSFT
CONTACTPROP_PUB_L1_CONTACTIDCOLLECTION property is misspelled in MSDN documentation

The documentation on http://msdn.microsoft.com/en-us/library/ms735869(VS.85).aspx and the implementation in icontactproperties.h in the Windows SDK differs on the definition of CONTACTPROP_PUB_L1_CONTACTIDCOLLECTION.

In the header file it is called CONTACTPROP_PUB_L1_CONTACTIDCOLLECTION while in the documentation it is called CONTACTPROP_PUB_L1_CONTACTIDS.


The definition can be found on line 134 in icontactproperties.h. The default installation of the Windows SDK places this file in c:\program files\microsoft SDKs\Windows\v6.1\Include

Tags :

Page view tracker