The NewDl method create a new Distribution List object.
Set objNewDl = objElements.NewDl( [showWindow]
[, Name] [, parentWindow] [, createFlag] )
Applies To : Elements
||In / Out
||Required / Optional
||If True (the default), display a
window dialog box to prompt the user for enter information of the new Dl.
If False, the new Dl is created without asking information to user,
but the parameter Name is Mandatory.
||This parameter is the PR_DISPLAY_NAME
of the new Dl. The Name parameter is ignored unless showWindow
||Specifies the parent window handle for
the dialog box. A value of zero (the default) specifies that the dialog
box should be application-modal. A value of 1 specifies that the
currently active window is to be used as the parent window. The parentWindow
parameter is ignored unless showWindow is True.
Value of type enumCreateFlag that specifies the flags that affect creation behavior.
The createFlag parameter is ignored unless showWindow is False.
The following flags may be set:
- createNoCheck (default) : Indicates no check is made for duplicate entry
- createCheckDupLoose :
Indicates that duplicate entry checking be performed loosely, which returns more matches than setting strict
duplicate entry checking with the flag createCheckDupStrict. For example, a provider can define a loose match
as any two entries that have the same display name, while defining a strict match as any two entries that have
the same display name and messaging address.
- createCheckDupStrict :
Indicates that duplicate entry checking be performed strictly, which returns fewer matches than setting loose
duplicate entry checking with the flag createCheckDupLoose.
- createReplace :
Causes duplicate entries to replace existing entries within a container.
- createMerge :
Causes the existing properties on the entry to be updated with the new set of properties when a collision occurs.
createMerge must be used in conjunction with the createReplace flag. The new properties replace any properties
that exist in both versions of the contacts. Any properties that do not overlap are not affected, and are saved
on the entry. The flag is useful if you want to update partial information on a contact.
Return Value :
On successful return, contains the new Dl object.
When you open the Session without an identity (EnableProfiles is False)
the new distribution list is created in the shared contacts folder. If the user
click on Cancel button the method raise the MAPI_E_USER_CANCEL
Dim objMyDl, objSession
Set objMyDl = objSession.Containers.Item(1).Elements.NewDl()