ChrisOswald
Active Member
- Joined
- Jan 19, 2010
- Messages
- 454
In Office 2003, I'm needing to be able to loop through all the distribution lists in a public folder and return the email addresses associated with each list.
This vbscript from http://technet.microsoft.com/en-us/library/ee692878.aspx works only for the default contacts folder.
If my public folder containing these items is
\\Public Folders\All Public Folders\CityName\Division Name\Pricing Support
how would I modify to have it use this folder instead of the
This vbscript from http://technet.microsoft.com/en-us/library/ee692878.aspx works only for the default contacts folder.
Code:
Const olFolderContacts = 10
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set colContacts = objNamespace.GetDefaultFolder(olFolderContacts).Items
intCount = colContacts.Count
For i = 1 To intCount
If TypeName(colContacts.Item(i)) = "DistListItem" Then
Set objDistList = colContacts.Item(i)
Wscript.Echo objDistList.DLName
For j = 1 To objDistList.MemberCount
Wscript.Echo objDistList.GetMember(j).Name & " -- " & _
objDistList.GetMember(j).Address
Next
Wscript.Echo
End If
Next
If my public folder containing these items is
\\Public Folders\All Public Folders\CityName\Division Name\Pricing Support
how would I modify to have it use this folder instead of the