The IABContainer::CopyEntries method copies one or more entries, typically messaging users or distribution lists.
See IABContainer : IMAPIContainer.
HRESULT CopyEntries(
LPENTRYLIST lpEntries,
ULONG ulUIParam,
LPMAPIPROGRESS lpProgress,
ULONG ulFlags
);
The IABContainer::CopyEntries method copies recipients from the same container or a different container. A call to CopyEntries is functionally equivalent to making the following three calls for each recipient to be copied:
The personal address book (PAB) supplied by MAPI does not support the CREATE_REPLACE flag. For duplicate entry checking, the PAB defines "loose" to mean that two entries are duplicates if their original display names are equal and "strict" to mean that two entries are duplicates if both their original display names and search keys are equal. In the PAB, the original display name is defined as the transmittable display name, if available. Otherwise, it is simply the display name. Combined with the PR_SEARCH_KEY property, these criteria usually eliminate duplicates in most applications whether automated or user driven.
All containers that support IABContainer::CopyEntries must be modifiable. Set your container's AB_MODIFIABLE flag in its PR_CONTAINER_FLAGS property to indicate that it is modifiable.
You must support all of the ulFlags flags; however, the interpretation and use of these flags is implementation-specific. That is, you can determine what the semantics of CREATE_CHECK_DUP_LOOSE and CREATE_CHECK_DUP_STRICT mean within the context of your implementation. If you cannot or do not determine whether an entry is a duplicate, always allow the entry to be copied.
If CREATE_REPLACE is set, always copy the entry regardless of whether CREATE_CHECK_DUP_LOOSE or CREATE_CHECK_DUP_STRICT is set and whether or not the entry is a duplicate.
If CREATE_REPLACE is not set and CREATE_CHECK_DUP_STRICT is set, check for duplicates. If any entries are determined to be duplicates, do not copy the entry.
You do not need to support the CREATE_REPLACE flag; not supporting CREATE_REPLACE means that you can ignore it and always perform a copy.
Return the warning MAPI_W_PARTIAL_COMPLETION only if a nonduplicate entry cannot be copied.
Use the CREATE_CHECK_DUP_LOOSE and CREATE_CHECK_DUP_STRICT flags to suggest to the provider how you would like the container to perform duplicate entry checking. If you need to have an entry added regardless of whether or not it is a duplicate, either do not set either of these flags or set the CREATE_REPLACE flag. CREATE_REPLACE indicates that you do not care if an entry is a duplication; you always want it to replace the original entry.
ENTRYLIST, IABContainer::CreateEntry, IMAPIProgress : IUnknown, IMAPIProp::SaveChanges