
Recipient Containers Help!!!
This is meant to run in Outlook, but you can modify it (and take out the
test for address entry type)
'
' This routine runs from a command button "ComTest", and fills a list box
"ListBox1"
' with the names of all Global Distribution Lists
'
Sub ComTest_Click()
Const CdoDistList = 1 'A public distribution list.
Const CdoAddressListGAL = 0 'Global Address List
set objSession = CreateObject("MAPI.Session")
objSession.Logon ,,,False
set objList = Item.GetInspector.ModifiedFormPages("Message").ListBox1
objList.Clear
Set objAddressList = objSession.GetAddressList(CdoAddressListGAL)
Set colAddressEntries = objAddressList.AddressEntries
For Each objAddressEntry In colAddressEntries
If objAddressEntry.DisplayType = CdoDistList Then
objList.AddItem objAddressEntry.Name
End If
Next
objSession.Logoff
set objSession = Nothing
End Sub
Quote:
> In VB I'm trying to fill a ComboBox with a list of all Recipient
Containers
> from the Exchange Server. However, I have no idea how to get a list of
> them. If anyone knows a why to do this, I'd greatly appreciate it :)
> Jim Kallio