2 Methods to Export All Members of an Outlook Contact Group to Excel

At times, you may want to export the members in a certain Outlook contact group. So this article will share you 2 means to extract the group members to Excel.

Outlook offers a native feature which permits you to export all the contacts of a certain contact folder. However, it doesn’t allow you to export contact groups, not to mention extracting the members in the contact groups. Therefore, if you would like to extract the members of a selected contact group, you need to make some more efforts. Here are two tips you can refer to.

Method 1: Extract the Group Members Via Save As

  1. At the very outset, launch Outlook.
  2. Then find and select the contact group whose members you need to extract.
  3. Next you should go to “File” menu and click “Save As”.
  4. Subsequently, in the popup “Save As” dialog box, select a destination folder to save and choose “Text Only” from the drop down list of “Save as type”.
  5. And then click “Save”.Save the Contact Group as Text Only
  6. After that, open Excel and create a new excel file.
  7. Later you should turn to “File” and click “Open” button.
  8. In the subsequent “Open” dialog box, you should first access the folder where you saved the contact group just now.
  9. Then click the second box in the “File name” line and select “All Files” from its drop down list.
  10. After that, pitch on the Text file for the contact group and hit “Open”.Open the Text File by Excel
  11. In the popup “Text Import Wizard” dialog box, ensure that the “Delimited” is selected and click “Finish” button.Finish Text Import Wizard
  12. Finally you will get the members, like the following screenshot:Extracted Members in the Excel Workbook

Method 2: Extract the Group Members via Outlook VBA

  1. In the first place, press “Alt + F11” key buttons in Outlook.
  2. Then open a new module in the VBA editor window.
  3. Subsequently, copy the following VBA codes into it.
Sub ExtractContactGroupMembersToExcel()
    Dim objContactGroup As Outlook.DistListItem
    Dim objMember As Outlook.recipient
    Dim objExcelApp As Excel.Application
    Dim objExcelWorkBook As Excel.Workbook
    Dim objExcelWorkSheet As Excel.Worksheet
    Dim i As Integer
    Dim nRow As Integer
    Dim strPath As String
    Dim strFilename As String
 
    Select Case Application.ActiveWindow.Class
           Case olExplorer
                Set objContactGroup = Application.ActiveExplorer.Selection(1)
           Case olInspector
                Set objContactGroup = Application.ActiveInspector.CurrentItem
    End Select
 
    If TypeOf objContactGroup Is DistListItem Then
       'Create a new Excel workbook
       Set objExcelApp = CreateObject("Excel.Application")
       Set objExcelWorkBook = objExcelApp.Workbooks.Add
       Set objExcelWorkSheet = objExcelWorkBook.Worksheets(1)
 
       'Set the two column headers
       objExcelWorkSheet.Cells(1, 1) = "Contact Name"
       objExcelWorkSheet.Cells(1, 2) = "Email Address"

       nRow = 2
 
       'Extract the contact group members' names and email addresses
       For i = 1 To objContactGroup.MemberCount
           Set objMember = objContactGroup.GetMember(i)
           objExcelWorkSheet.Cells(nRow, 1) = objMember.Name
           objExcelWorkSheet.Cells(nRow, 2) = objMember.Address
           nRow = nRow + 1
       Next
 
       'AutoFit the columns in the new Excel worksheet
       objExcelWorkSheet.Columns("A:B").AutoFit
 
       'Change the strPath to your actual case
       strPath = "C:\Contact Groups\"
       strFilename = strPath & objContactGroup.DLName & ".xlsx"
 
       'Save the Excel workbook
       objExcelWorkBook.Close True, strFilename
 
       'Notify you of the export complete
       MsgBox ("Export Complete!")
    End If
End Sub

VBA Codes - Export All Members of an Outlook Contact Group to Excel

  1. After that, you can add the macro to Quick Access Toolbar (QAT) as usual.
  2. Later, you can select a contact group and click the macro button in QAT.Run the Macro in Quick Access Toolbar
  3. After exporting, you will receive a message – “Export Complete!”Export Complete
  4. Eventually, you can find the Excel file in the folder which is predetermined in VBA codes. Open it, you can see the group members, like the image below:Extracted Members in the Excel via Outlook VBA

Get Back Your Previous PST Data

As Outlook is susceptible to crash, your PST data can get corrupted without any omens. Therefore, you should make a regular backup of your PST files. Also, you had better prepare a potent tool, such as DataNumen Outlook Repair, which can repair Outlook data on a timely basis.

Author Introduction:

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

Comments are closed.