PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Distribution List

Reply

Distribution List

 
Thread Tools Rate Thread
Old 08-11-2005, 03:10 PM   #1
=?Utf-8?B?SXJlbmU=?=
Guest
 
Posts: n/a
Default Distribution List


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

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off