2 Methods to Batch Attach All Contacts in a Specific Color Category to an Outlook Email

Some users ask for a quick solution to quickly find out all the contacts in a specific color category and then attach them to a new Outlook mail. Now, in this article, we will introduce 2 approaches.

At times, you may need to send specific contacts to someone else via email. For instance, you’ve color categorized your contacts. Thus, you want to quickly attach all the contacts in a specific color category to an email. Looking at this issue, here we will share you 2 means with you. You can use either as per your preference.

Batch Attach All Contacts in a Specific Color Category to an Outlook Email

Method 1: Use “Instant Search” & “Forward Contact” Feature

  1. To begin with, launch Outlook program.
  2. Then, access to a Contacts folder.
  3. Next, click into the search box above the contact list.
  4. Subsequently, in the emerging “Search” ribbon, you should change the search “Scope” to the “All Contact Items”.Change Search Scope
  5. After that, you need to click the “Categorize” button.
  6. Later, from the category list, select the specific color category.Select Color Category
  7. When the search results display, you should select all the found contacts.
  8. Afterwards, click on the “Forward Contact” button in the “Share” group under “Home” tab.
  9. From the drop down list, select “As a Business Card” or “As an Outlook Item”.Forward Found Contacts
  10. Finally, a new email will show up, attached with all the selected contact. It’ll look like the following screenshot.Attached Contacts in Email

Method 2: Utilize Outlook VBA Code

  1. First off, access Outlook VBA editor by pressing “Alt + F11” key buttons.
  2. Then, copy and paste the following VBA code into a module.
Dim strCategory As String
Dim objMail As MailItem

Sub AttachAllContactsInSpecificColorCategoryToEmail()
    Dim objStore As store
    Dim objFolder As Folder
 
    'Input the color category name
    strCategory = InputBox("Enter a color category name:")
    
    If Trim(strCategory) <> "" Then
       Set objMail = Outlook.Application.CreateItem(olMailItem)
 
       'Process all stores in your Outlook
       For Each objStore In Application.Session.Stores
           For Each objFolder In objStore.GetRootFolder.Folders
               If objFolder.DefaultItemType = olContactItem Then
                  Call ProcessFolders(objFolder)
               End If
           Next
       Next
 
       objMail.Display
   End If
End Sub

Sub ProcessFolders(ByVal objCurrentFolder As Folder)
    Dim objItem As Object
    Dim objContact As ContactItem
 
    'Change the mailing address to home address field
    For Each objItem In objCurrentFolder.Items
        If objItem.Class = olContact Then
           Set objContact = objItem
           If InStr(LCase(objContact.Categories), LCase(strCategory)) > 0 Then
              objMail.Attachments.Add objContact
           End If
        End If
    Next
 
    'Process all subfolders recursively
    If objCurrentFolder.Folders.Count > 0 Then
       For Each objSubFolder In objCurrentFolder.Folders
           Call ProcessFolders(objSubFolder)
       Next
    End If
End Sub

VBA Code - Batch Attach All Contacts in a Specific Color Category to an Outlook Email

  1. Subsequently, click in the “AttachAllContactsInSpecificColorCategoryToEmail” subroutine.
  2. After that, press “F5” key button.
  3. At once, you will be required to enter the name of specific color category.Input Specific Color Category Name
  4. Ultimately, a new mail will display with all the contacts in the specific color category attached.New Email from VBA Code

Keep Vigilant against Potential Risks around Outlook

As a regular user of Outlook, you have to always keep alert in that there are many risks surrounding your Outlook, such as malicious links, virus borne attachments and so on. Therefore, you have to never download files or click the links in the unknown emails. Of course, so as to provide immediate rescue, you ought to get hold of a well-proven and credible PST recovery tool, like DataNumen Outlook Repair. It is able to fix Outlook files without any ado.

Author Introduction:

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