IABContainer::CreateEntryIABContainer::CreateEntry*
*Contents  *Index  *Topic Contents
*Previous Topic: IABContainer::CopyTo
*Next Topic: IABContainer::DeleteEntries

IABContainer::CreateEntry

HRESULT CreateEntry(
    ULONG       cbEntryID,
    LPENTRYID   lpEntryID,
    ULONG       ulCreateFlags,
    LPMAPIPROP  lppMAPIPropEntry
);

Creates a new entry in the address book container. Internet Explorer Address Book supports creating new address book objects IDistList for a distribution list and IMailUser for a messaging user. Internet Explorer Address Book might support creation of subcontainers in a future version.

cbEntryID
Size, in bytes, of the existing entry identifier to copy from, in the lpEntryID parameter.
lpEntryID
Entry identifier of the object to copy from.
ulCreateFlags
Bitmask of flags that control how entry creation is performed. The following flags can be set:
CREATE_CHECK_DUP_LOOSE
Indicates a loose level should be used for duplicate entry checking, which returns more matches than setting a strict level with the CREATE_CHECK_DUP_STRICT flag. For example, a provider can define a loose match as any two entries having the same display name.
CREATE_CHECK_DUP_STRICT
Indicates a strict level should be used for duplicate entry checking, which returns fewer matches than setting a loose level with the CREATE_CHECK_DUP_LOOSE flag. For example, a provider can define a strict match as any two entries having the same display name and messaging address.
CREATE_REPLACE
Indicates that duplicate entries replace existing entries within a container.
lppMAPIPropEntry
Returned property interface to a new object.

These flags are valid only for the instance of the object returned by CreateEntry. There is no way in the API to get the SetProps or the SaveChanges method to check for duplicates on an object returned by OpenEntry. To do duplicate checking on SaveChanges of an object returned by OpenEntry, the caller would have to do the following:

  1. Modify any of the name fields in the user interface: PR_SURNAME, PR_GIVEN_NAME, PR_COMPANY_NAME, or PR_DISPLAYNAME.
  2. Delete the old contact.
  3. Use CreateEntry to create a new entry with the CREATE_CHECK_DUP_LOOSE flag, set the properties, and save the changes. On failure, restore the original entry.

Back to top


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.