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
- At the very outset, launch Outlook.
- Then find and select the contact group whose members you need to extract.
- Next you should go to “File” menu and click “Save As”.
- 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”.
- And then click “Save”.
- After that, open Excel and create a new excel file.
- Later you should turn to “File” and click “Open” button.
- In the subsequent “Open” dialog box, you should first access the folder where you saved the contact group just now.
- Then click the second box in the “File name” line and select “All Files” from its drop down list.
- After that, pitch on the Text file for the contact group and hit “Open”.
- In the popup “Text Import Wizard” dialog box, ensure that the “Delimited” is selected and click “Finish” button.
- Finally you will get the members, like the following screenshot:
Method 2: Extract the Group Members via Outlook VBA
- In the first place, press “Alt + F11” key buttons in Outlook.
- Then open a new module in the VBA editor window.
- 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
- After that, you can add the macro to Quick Access Toolbar (QAT) as usual.
- Later, you can select a contact group and click the macro button in QAT.
- After exporting, you will receive a message – “Export Complete!”
- 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:
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