I couldn't find my code for adding users to a Workgroup, but a newsgroup
post search turned up this code for loopin through lists and contacts.
Problem is that new outlook security issues prevent access. You'd have to
also implement Redemption code, unless you just run this once for an initial
load.
Here's code I found from Doug Haigh. He said there was an issue with it,
but I was able to run it and output lists and contact names to the debug
window. It will take some work to adapt, but it will work.
Danny
Function foo()
Dim ol As New Outlook.Application
Dim ns As Outlook.NameSpace
Dim newMail As MailItem
Set ns = ol.GetNamespace("MAPI")
ns.Logon , , False, True
Dim aPAB() As Variant
Dim adl As Outlook.AddressList
Dim dl As Outlook.AddressEntry
Dim ae As Outlook.AddressEntry
Dim dle As Outlook.AddressEntries
Dim i As Integer
ReDim aPAB(100, 2)
Set ns = ol.GetNamespace("MAPI") 'Return the personal address book.
For Each adl In ns.AddressLists
Debug.Print "Address list name is " & adl.Name
If adl.Name = "Contacts" Then
Debug.Print "There are " & adl.AddressEntries.Count & " entries in
this list."
For Each dl In adl.AddressEntries
Debug.Print "Entry #" & i & " is " & dl.Name & " of type " &
dl.Type & " display type " & dl.DisplayType
i = i + 1
If dl.Type = "MAPIPDL" Then
'
' NOTE: The following line works just fine and I see the
Entries
'
dl.Details
'
' NOTE: The following line produces a COM error
'
Debug.Print "There are " & dl.Members.Count & " entries in
the list"
End If
Next
End If
Next
End Function