Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-15-2015, 07:44 PM
JohnFurter JohnFurter is offline How do I extract all my email addresses into one file? Windows 8 How do I extract all my email addresses into one file? Office 2010 64bit
Novice
How do I extract all my email addresses into one file?
 
Join Date: May 2015
Posts: 2
JohnFurter is on a distinguished road
Default How do I extract all my email addresses into one file?

When I'm exporting my contact list from outlook.com into csv file there's only one contact.



I click people tab, then manage and then "export for outlook and other services". The downloaded file contains only one contact as well as whole "people" tab. (same with the option: "export for outlook 2010 and 2013")

But I have hundreds emails in my inbox.

How do I extract all my email addresses into one file?

Please advice.
Reply With Quote
  #2  
Old 05-15-2015, 09:33 PM
gmayor's Avatar
gmayor gmayor is offline How do I extract all my email addresses into one file? Windows 7 64bit How do I extract all my email addresses into one file? Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,105
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Outlook.com is a web based e-mail application, unfortunately named to clash with the Outlook application that is part of Office. Just because you have hundreds of e-mails in your inbox, it doesn't follow that the corresponding senders will be listed in the Outlook.com address book.

If you were to access Outlook.com from the Outlook (part of Office) application, you may be able to process the e-mail messages to extract the sender details, but it would require a process to be created in VBA.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 05-15-2015, 09:50 PM
JohnFurter JohnFurter is offline How do I extract all my email addresses into one file? Windows 8 How do I extract all my email addresses into one file? Office 2010 64bit
Novice
How do I extract all my email addresses into one file?
 
Join Date: May 2015
Posts: 2
JohnFurter is on a distinguished road
Default

Thanks gmayor. It was a hotmail first, then they transited it to outlook.com. I have desktop Outlook 2013 (the one part of the Office).

I checked contacts - there's only one as well.

Is there an instruction how to do it vi VBA?
Reply With Quote
  #4  
Old 05-16-2015, 04:32 AM
gmayor's Avatar
gmayor gmayor is offline How do I extract all my email addresses into one file? Windows 7 64bit How do I extract all my email addresses into one file? Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,105
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Based largely on Sue Mosher's code at http://www.outlookcode.com/d/code/autoaddrecip.htm, the following macro will add the sender's of each e-mail in the selected Outlook folder to the Outlook contacts list.

Although aimed at Word, the VBA editor in Outlook is virtually identical to that shown in the tutorial at http://www.gmayor.com/installing_macro.htm

Code:
Option Explicit

Sub AddFolderToContacts()
Dim olFolder As Folder
Dim olExpl As Explorer
Dim olItem As MailItem
    Set olExpl = ActiveExplorer
    If Not olExpl Is Nothing Then
        Set olFolder = olExpl.CurrentFolder
        For Each olItem In olFolder.Items
            MsgBox olItem.Sender
            AddEmailToContacts olItem
        Next olItem
    End If
lbl_Exit:
    Set olItem = Nothing
    Set olExpl = Nothing
    Set olFolder = Nothing
    Exit Sub
End Sub

Sub AddEmailToContacts(objMail As Outlook.MailItem)
Dim strFind As String
Dim strAddress As String
Dim objNS As Outlook.NameSpace
Dim colContacts As Outlook.Items
Dim objContact As Outlook.ContactItem

Dim i As Integer
    On Error Resume Next

    ' get Contacts folder and its Items collection
    Set objNS = Application.GetNamespace("MAPI")
    Set colContacts = _
    objNS.GetDefaultFolder(olFolderContacts).Items

    ' process message recipients
    ' check to see if the recip is already in Contacts
    strAddress = objMail.SenderEmailAddress
    For i = 1 To 3
        strFind = "[Email" & i & "Address] = " & _
                  strAddress
        Set objContact = colContacts.Find(strFind)
        If Not objContact Is Nothing Then
            Exit For
        End If
    Next i

    ' if not, add it
    If objContact Is Nothing Then
        Set objContact = _
        Application.CreateItem(olContactItem)
        With objContact
            .FullName = objMail.SenderName
            .Email1Address = strAddress
            .Save
        End With
    End If
    Set objContact = Nothing

lbl_Exit:
    Set objNS = Nothing
    Set objContact = Nothing
    Set colContacts = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
extract node values from an XML file and insert into body of an email afppaul Outlook 2 05-07-2014 08:45 AM
How do I extract all my email addresses into one file? need to extract email addresses from excel files dunndealpr Excel 3 06-07-2013 08:29 AM
How do I extract all my email addresses into one file? Duplicate Email Addresses lh66 Outlook 2 02-20-2011 07:32 PM
How do I extract all my email addresses into one file? Extract email address from field zssteen Excel 1 06-19-2009 02:32 AM
How Many Email Addresses Can You email at one time in Outlook zinfandel72 Outlook 2 08-04-2008 06:39 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft