axism
MIS
- May 17, 2005
- 58
i have the following code:
my question ism if i have a distribution list name like "abc" in my contact list in outlook, can i just use the set tempdist above and use that loop to retrieve all members in that dist list?
Code:
Dim olapp As New Outlook.Application
Dim namespace As Outlook.namespace
Dim folder As Outlook.MAPIFolder
Dim folderitems As Outlook.Items
Dim totalcounts As Integer
Dim contactcount As Integer
Dim tempdist as DistListItem
Set namespace = olapp.GetNamespace("MAPI")
Set folder = namespace.GetDefaultFolder(olFolderContacts)
Set folderitems = folder.Items
Set tempdist = "ABC"
totalcounts = = tempdist.MemberCount
For contactcount = 1 To totalcounts
msgbox tempdist.GetMember(iteraddress).Name
next contactcount
End sub
my question ism if i have a distribution list name like "abc" in my contact list in outlook, can i just use the set tempdist above and use that loop to retrieve all members in that dist list?