P
paresh
Hi,
I have written attached code for creating distribution list and
adding/enumerating it's members. I want to put a check before creating
distribution list or adding members into existed distribution list.
1. If DL is exists then it should not create it again and it should
add member to existed DL.
2. If DL is not exists then it should create it and add member.
Thanks.
Dim DL As Outlook.DistListItem
Dim rcp As Outlook.Recipient
Set DL = Application.CreateItem(olDistributionListItem)
DL.DLName = "MyList"
Set rcp = Application.Session.CreateRecipient(userName)
rcp.Resolve
If rcp.Resolved = True Then
DL.AddMember rcp
End If
DL.Save
I have written attached code for creating distribution list and
adding/enumerating it's members. I want to put a check before creating
distribution list or adding members into existed distribution list.
1. If DL is exists then it should not create it again and it should
add member to existed DL.
2. If DL is not exists then it should create it and add member.
Thanks.
Dim DL As Outlook.DistListItem
Dim rcp As Outlook.Recipient
Set DL = Application.CreateItem(olDistributionListItem)
DL.DLName = "MyList"
Set rcp = Application.Session.CreateRecipient(userName)
rcp.Resolve
If rcp.Resolved = True Then
DL.AddMember rcp
End If
DL.Save