How to export mail id from outlook 2007

To export email addresses from Outlook 2007, you can follow these steps:

Method 1: Exporting Contacts

  1. Open Outlook 2007 and go to the "Contacts" folder.
  2. Select all contacts by pressing Ctrl+A or by selecting the first contact and then Shift+clicking on the last contact.
  3. Right-click on the selected contacts and choose "Export Contacts" from the context menu.
  4. In the "Export Contacts" wizard, select "Comma Separated Values (Windows)" as the export format.
  5. Choose a location to save the file and enter a file name.
  6. Click "Export" to export the contacts.

The exported file will contain the email addresses in the format:

"First Name" <email address>

Method 2: Exporting Email Addresses from the Global Address List (GAL)

  1. Open Outlook 2007 and go to the "Address Book" (or "Contacts" if you have the "Contacts" folder set as the default address book).
  2. Click on the "Global Address List" (GAL) button in the "Address Book" window.
  3. Select all contacts by pressing Ctrl+A or by selecting the first contact and then Shift+clicking on the last contact.
  4. Right-click on the selected contacts and choose "Export Contacts" from the context menu.
  5. In the "Export Contacts" wizard, select "Comma Separated Values (Windows)" as the export format.
  6. Choose a location to save the file and enter a file name.
  7. Click "Export" to export the contacts.

The exported file will contain the email addresses in the format:

"First Name" <email address>

Method 3: Using VBA Macro

  1. Open Outlook 2007 and go to the "Developer" tab (if you don't see the "Developer" tab, go to "Tools" > "Trust Center" > "Macro Settings" and enable the "Developer" tab).

  2. Click on the "Visual Basic" button in the "Developer" tab.

  3. In the Visual Basic Editor, click on "Insert" > "Module" to insert a new module.

  4. Paste the following code into the module:

    Sub ExportEmailAddresses()
     Dim olApp As New Outlook.Application
     Dim olNamespace As Outlook.Namespace
     Dim olAddressList As Outlook.AddressList
     Dim olContact As Outlook.ContactItem
     Dim strFile As String
     Dim strLine As String
    
     strFile = "C:\EmailAddresses.csv" ' change this to your desired file location and name
    
     Set olNamespace = olApp.GetNamespace("MAPI")
     Set olAddressList = olNamespace.GetAddressList("Global Address List")
    
     Open strFile For Output As #1
     For Each olContact In olAddressList.GetContacts()
         strLine = olContact.FullName & " <" & olContact.Email1Address & ">"
         Write #1, strLine
     Next olContact
     Close #1
    
     Set olContact = Nothing
     Set olAddressList = Nothing
     Set olNamespace = Nothing
     Set olApp = Nothing
    End Sub
  5. Click "Run" to run the macro.

  6. The macro will export the email addresses to a CSV file named "EmailAddresses.csv" in the specified location.

Note: Make sure to adjust the file path and name in the code to match your desired location and file name.