Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-28-2015, 01:32 PM
Wikus Botha Wikus Botha is offline Contacts Windows 7 64bit Contacts Office 2010 64bit
Novice
Contacts
 
Join Date: Jun 2015
Posts: 1
Wikus Botha is on a distinguished road
Default Contacts

Hi


I have send emails out to my adress book using my groups instead of sending it individually. There are people that want to unsubscribe. How do I find in which group the specific contact is without searching each group manually?
I have like 30 groups with about 80 adress in each. You can imagine how long that is going to take manually.

Please respond
Thank you
Wikus
Reply With Quote
  #2  
Old 06-28-2015, 09:54 PM
gmayor's Avatar
gmayor gmayor is offline Contacts Windows 7 64bit Contacts Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The following macro will list the groups a named member appears in:
Code:
Sub ListDistributionGroupNamesContainingMember()
Dim olNameSpace As Outlook.NameSpace
Dim olFolder As Outlook.Folder
Dim olDistList As Outlook.DistListItem
Dim olFolderItems As Outlook.Items
Dim olListMember As String
Dim sList As String
Dim x As Integer
Dim y As Integer
Dim iCount As Integer

    olListMember = LCase(InputBox("Enter name of list member to be found", _
                                  "Find name in Distribution Lists"))
    Set olNameSpace = GetNamespace("MAPI")
    Set olFolder = olNameSpace.GetDefaultFolder(olFolderContacts)
    Set olFolderItems = olFolder.Items
    iCount = olFolderItems.Count
    sList = ""
    For x = 1 To iCount
        If TypeName(olFolderItems.Item(x)) = "DistListItem" Then
            Set olDistList = olFolderItems.Item(x)
            For y = 1 To olDistList.MemberCount
                If InStr(1, olDistList.GetMember(y).Name, olListMember) Then
                    If sList = "" Then
                        sList = sList & olDistList.GetMember(y).Name _
                                & Chr(32) & ChrW(8212) & Chr(32) & olDistList.DLName
                    Else
                        sList = sList & vbCr & olDistList.GetMember(y).Name _
                                & Chr(32) & ChrW(8212) & Chr(32) & olDistList.DLName
                    End If
                End If
            Next y
        End If
    Next x
    MsgBox sList
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Syncing selected contacts between "Contacts" list and "Business Contacts" Derick Sturke Outlook 0 05-29-2014 03:52 PM
Copy Excel sheet (contacts) to Outlook Contacts using VBA szchris384 Outlook 0 03-01-2014 05:48 PM
import public contacts to local contacts nickl Outlook 2 09-16-2011 05:22 AM
Contacts How to automatic save Sending or replying contacts e-mails into contacts? biologus Outlook 1 09-12-2011 01:14 PM
Two Contacts, Same Address! Mail merging married contacts?!! tomtomlo Outlook 0 03-26-2008 03:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft