DLName Property

Microsoft Outlook Visual Basic

DLName Property

       

Returns or sets a String representing the display name of a distribution list. Read/write.

expression.DLName

expression   Required. An expression that returns a DistListItem object.

Example

This Microsoft Visual Basic/Visual Basic for Applications example creates a new distribution list and then prompts the user for the name.

Dim myOlApp As New Outlook.Application
Dim myDistList As Outlook.DistListItem
Set myDistList = myOlApp.CreateItem(olDistributionListItem)
myDistList.DLName = InputBox("Type the name of the new distribution list.")
myDistList.Display

If you use VBScript, you do not create the Application object, and you cannot use named constants. This example shows how to perform the same task using VBScript.

Set myDistList = Application.CreateItem(7)
myDistList.DLName = _
    InputBox("Type the name of the new distribution list.")
myDistList.Display