This topic has not yet been rated - Rate this topic

DistListItem.AddMember Method (Outlook)

Published: July 16, 2012

Adds a new member to the specified distribution list. The distribution list contains Recipient objects that represent valid e-mail addresses.

expression .AddMember(Recipient)

expression A variable that represents a DistListItem object.

Parameters

Name

Required/Optional

Data Type

Description

Recipient

Required

Recipient

The recipient to be added to the list.

Use the AddMembers method to add multiple members to a given distribution list.

The following Microsoft Visual Basic for Applications (VBA) example creates a new DistributionList object and adds a recipient to it. If the specified recipient is not valid, the AddMember method will fail. To run this example, replace 'Dan Wilson' with a valid recipient name.

Sub AddNewMember() 
 
 'Adds a member to a new distribution list 
 
 
 
 Dim objItem As Outlook.DistListItem 
 
 Dim objMail As Outlook.MailItem 
 
 Dim objRcpnt As Outlook.Recipient 
 
 
 
 Set objMail = Application.CreateItem(olMailItem) 
 
 
 
 Set objItem = Application.CreateItem(olDistributionListItem) 
 
 'Create recipient for distlist 
 
 Set objRcpnt = Application.Session.CreateRecipient("Dan Wilson") 
 
 objRcpnt.Resolve 
 
 objItem.AddMember objRcpnt 
 
 'Add note to list and display 
 
 objItem.DLName = "Northwest Sales Manager" 
 
 objItem.Body = "Regional Sales Manager - NorthWest" 
 
 objItem.Save 
 
 objItem.Display 
 
End Sub
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.