Webmasters, gagnez de l'argent en affichant des bannières contextuelles Oxado
SourceForge.net Logo
Support This Project Free Downloads
WABAccess Project
Welcome ! [ Home ]  ·  [ Downloads ]  ·  [ Forums ]  ·  [ News ]  ·  [ Documentations ]  
[ Home ]

[ Documentations ]

Remove a member from a Distribution List

To remove a member of a distribution list you must use the Remove method of the Members Collection. You can give either a position index or the identifier of the member to remove. If the entry does not exist in the collection an error is raised.

Dim objSession, objContact, objDl


Set objDl = CreateNewDl( "My Society" )
Set objContact = CreateNewContact( "John", "SMITH" )
objDl.Members.Add objContact.ID
objDl.Members.NewOneOff "John SMITH", "john.smith@mysociety.com"

MsgBox "Number of members " & objDl.Members.Count

' loop on each member of the distribution list
For Each objEntry In objDl.Members
    ' remove the entry
    objDl.Members.Remove objEntry.ID

MsgBox "Number of members " & objDl.Members.Count