How to Quickly Create a Contact Group from a Specific Type of Recipients in Multiple Outlook Emails

At times, you may want to quickly extract a specific type of recipients in many mails and then create a contact group from them. You can choose to manually get it. But, in comparison with the method shared in this article, it is too tedious.

Email recipients can be divided into three types – “To”, “CC” and “BCC” recipients. Therefore, sometimes, you may want to do something only with a specific type of recipients. For instance, you hope to rapidly create a contact group from the “CC” recipients of multiple emails. Unquestionably, the common and standard method is to copy recipients to the group manually. Yet, it is too troublesome. So, here we will introduce another far more effective way.

Create a Contact Group from a Specific Type of Recipients in Multiple Emails

  1. For a start, access Outlook VBA editor according to “How to Run VBA Code in Your Outlook“.
  2. Then, in the new window, copy and paste the following code into a module or project.
Sub ContactGroup_SpecificTypeRecipients_MultipleEmails()
    Dim objSelection As Outlook.Selection
    Dim objItem As Object
    Dim objMail As Outlook.MailItem
    Dim objRecipient As Outlook.Recipient
    Dim i As Long
    Dim objContactGroup As Outlook.DistListItem
 
    'Get all selected emails
    Set objSelection = Outlook.Application.ActiveExplorer.Selection
 
    If Not (objSelection Is Nothing) Then
 
       'Create a contact group
       Set objContactGroup = Outlook.Application.CreateItem(olDistributionListItem)
 
       For Each objItem In objSelection
           Set objMail = objItem
 
           'Add the specific type of recipient to the contact group
           For i = objMail.Recipients.Count To 1 Step -1
               Set objRecipient = objMail.Recipients(i)
 
               'Change recipient type - olTo, olBCC or olCC
               If objRecipient.Type = olCC Then
                  objContactGroup.AddMember objRecipient
               End If
           Next
       Next
 
       'Display the contact group
       objContactGroup.Display
    End If
End Sub

VBA Code - Create a Contact Group from a Specific Type of Recipients in Multiple Emails

  1. After that, exit the VBA editor.
  2. Subsequently, for later convenience, add this macro to Quick Access Toolbar.
  3. Finally, follow the steps below to take a shot.
  • At first, select the emails as per your needs.
  • Then, click the macro button in Quick Access Toolbar.Run Macro on Selected Emails
  • At once, a new contact group will display, like the following figure.New Contact Group from CC Recipients

Restore Your Outlook Data

Have you ever been subject to knotty Outlook troubles, such as seriously corrupt Outlook data file? It is believed that no one is willing to accept it but it can occur at any time due to various factors. Hence, it is high time for regular users to make sufficient precautions, including making regular data backups, preparing a potent and credible external PST repair tool, like DataNumen Outlook Repair. Such that, even though Outlook file is compromised unexpectedly, you can recover PST data easily from backups or via the robust tool.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including SQL Server repair and outlook repair software products. For more information visit www.datanumen.com

Leave a Reply

Your email address will not be published. Required fields are marked *