How can I see which lists a contact is a member of?

A

Alan

Hello,

In Outlook 2007, is there a way to see which distribution lists a
contact is a member of? We have lots of lists. We want to be sure that
if we delete a contact in a group, instead of just removing it from
the group, that the contact doesn't exist in other groups as well.

Even a way to export to Excel would be ok, if there's nothing else.

Thanks,

- Alan.
 
G

Graham Mayor

The following macro in Outlook will list all the distribution lists
containing the name you enter into the dialog box in a Word document

Sub ListNames()
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim myNameSpace As Outlook.NameSpace
Dim myFolder As Outlook.Folder
Dim myDistList As Outlook.DistListItem
Dim myFolderItems As Outlook.Items
Dim myListMember As String
Dim sList As String
Dim x As Integer
Dim y As Integer
Dim iCount As Integer

myListMember = InputBox("Enter name of list member to be found", _
"Find name in Distribution Lists")
Set myNameSpace = Application.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderContacts)
Set myFolderItems = myFolder.Items
iCount = myFolderItems.Count
sList = ""
For x = 1 To iCount
If TypeName(myFolderItems.Item(x)) = "DistListItem" Then
Set myDistList = myFolderItems.Item(x)
For y = 1 To myDistList.MemberCount
If InStr(1, myDistList.GetMember(y).Name, myListMember) Then
'MsgBox myDistList.GetMember(y).Name & _
" is a member of " & myDistList.DLName, _
vbInformation, "Distribution List"
If sList = "" Then
sList = sList & myDistList.GetMember(y).Name _
& vbTab & myDistList.DLName
Else
sList = sList & vbCr & myDistList.GetMember(y).Name _
& vbTab & myDistList.DLName
End If
End If
Next y
End If
Next x
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err Then
Set wdApp = CreateObject("Word.Application")
End If
Set wdDoc = wdApp.Documents.Add
wdApp.Visible = True
wdApp.Activate
With wdDoc.Range
.InsertAfter sList
.ParagraphFormat.TabStops.ClearAll
.ParagraphFormat.TabStops.Add Position:=InchesToPoints(4), _
Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
End With
Set wdDoc = Nothing
Set wdApp = Nothing
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Gordon

Hello,

In Outlook 2007, is there a way to see which distribution lists a
contact is a member of? We have lots of lists.

Then you might like to look at Categories instead. You assign Categories
to a Contact, rather than adding a Contact to a D/L....much easier to
administer, without having to use macros. If you delete a contact then
that contact is automatically removed from the Categories you assigned
to it...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top