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
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