IContactProperties::GetPropertyCollection Method

Returns an IContactPropertyCollection for the current contact. Optionally, filters the IContactPropertyCollection to enumerate only some values.

Syntax

HRESULT GetPropertyCollection(      
    IContactPropertyCollection **ppPropertyCollection,
    DWORD dwFlags,
    LPCWSTR pszMultiValueName,
    DWORD dwLabelCount,
    LPCWSTR ppszLabels,
    BOOL fAnyLabelMatches
);

Parameters

  • ppPropertyCollection
    [out] On success, points to the new IContactPropertyCollection.
  • dwFlags
    [in] Must be CGD_DEFAULT.
  • pszMultiValueName
    [in] Specifies the name of the collection (for example: emailAddresses or [namespace]arrayNode). If NULL, all collections are searched for ppszLabels.
  • dwLabelCount
    [in] Specifies the number of labels in ppszLabels. If zero, all subproperties with labels are returned.
  • ppszLabels
    [in] Specifies an array of string labels to test for. All labels in the array must be set to a valid string (not NULL).
  • fAnyLabelMatches
    [in] TRUE if the presence of any label on a given property matches the property. FALSE if all labels must be present to match the property.

Return Value

Returns one of the following values:

S_OK Always returns success.

Remarks

Caller can enumerate all child properties of a top-level property with an optional label filter applied. For example: all emailAddresses where label="work". On success, collection has been reset to the location before the first element (if any are present). Call IContactPropertyCollection::Next to begin querying data.