PC Review


Reply
Thread Tools Rate Thread

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

 
 
Alan
Guest
Posts: n/a
 
      1st Aug 2010
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.
 
Reply With Quote
 
 
 
 
Graham Mayor
Guest
Posts: n/a
 
      1st Aug 2010
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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


"Alan" <(E-Mail Removed)> wrote in message
news:5f594c58-03c5-4dee-b8ec-(E-Mail Removed)...
> 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.



 
Reply With Quote
 
Alan
Guest
Posts: n/a
 
      2nd Aug 2010
Wow! Thanks very much Grahal, I'll give it a try.

On Aug 1, 4:07*pm, "Graham Mayor" <gma...@REMOVETHISmvps.org> wrote:
> 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
>
> My web sitewww.gmayor.com
> Word MVP web sitehttp://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
> "Alan" <bru...@gmail.com> wrote in message
>
> news:5f594c58-03c5-4dee-b8ec-(E-Mail Removed)...
>
> > 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.

>
>


 
Reply With Quote
 
Gordon
Guest
Posts: n/a
 
      5th Aug 2010
On 01/08/2010 12:43, Alan wrote:
> 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...
 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OL2000 disabling inplace editing for contact lists and task lists, etc Pedro CR Microsoft Outlook Discussion 1 18th Oct 2005 03:40 AM
OL2000 disabling inplace editing for contact lists and task lists, etc Pedro CR Microsoft Outlook Contacts 1 18th Oct 2005 03:40 AM
OL2000 disabling inplace editing for contact lists and task lists, etc Pedro CR Microsoft Outlook 0 15th Oct 2005 02:20 AM
OL2000 disabling inplace editing for contact lists and task lists, etc Pedro CR Microsoft Outlook Discussion 0 15th Oct 2005 02:20 AM
OL2000 disabling inplace editing for contact lists and task lists, etc Pedro CR Microsoft Outlook Contacts 0 15th Oct 2005 02:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:22 AM.