Distribution List

I

Irene

Hi everybody,

I would like to access a distribution list, then retrieve the company name
and fax number (etc) of the members of the distribution list. Is this
possible? The distribution lists are in a folder on the public folder tree. I
am using Outlook 2003 (vba) and Exchange 2003.

I am thinking of doing a search based on the display field name, can you do
that? All the members don’t have a email address.
How do I access a distribution list via CDO? Maybe that’s the way I should go.



code:

Dim myOlApp As New Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder
Dim myDistList As Outlook.DistListItem
Dim myFolderItems As Outlook.Items
Dim x As Integer
Dim y As Integer
Dim iCount As Integer
Dim name As String
Dim namedl As String
Dim mypos As Integer

Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.Folders("SCA FOLDER").Folders("Distribution
Lists")

Set myDistList = myFolder.Items(cbDistList.Value)
MsgBox myDistList.MemberCount

Set myContactFolder = myNameSpace.Folders("SCA FOLDER").Folders("SCA
Rolodex")
Set myFolderItems = myFolder.Items


For y = 1 To myDistList.MemberCount


namedl = myDistList.GetMember(y).name



Next y


Thanks,

Irene
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top