[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Need to import all contacts from CC field into outlook contacts

Posted on 2008-02-04
10
Medium Priority
?
499 Views
Last Modified: 2008-05-24
Hi,
How can I import all the emails from the outlook CC Field into my address book. Can I create a seperate Distribution list? I have over 100 emails in the cc field, which one of my employees sent out but I can't copy these emails or import these. I tried to copy all these emails into a notepad/excel but it looses the link. I can only copy the  names not the email addresses. I am sure there is a way and an expert on this board would know the answer. Please help.

Thanks in advance
0
Comment
Question by:wallstreetx
  • 4
  • 4
8 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 20822346
Hi, wallstreetx.

I'm not clear on what you're asking.  Are you saying that you want to import all the addresses in the cc field of a single message into Outlook or do you want to import the cc field of multiple messages?  Also, you mention importing the emails.  I assume you menat the email address.  If not, then please explain.
0
 

Author Comment

by:wallstreetx
ID: 20846373
Hi,

Sorry for not being clear. We usually send out emails to our clients and this job was performed by a person in my marketing department. She left and also deleted all files on her PC. Now only way I can retreive the email addresses of my clients is by copying the email addresses from a CC field of one of the emails she sent out and where I was also cc'd. Now, if I try to copy these email addresses in the cc field, they lose the link. It just shows the names not the email address i.e If I copy all email addresses from the cc field, email will be copied like "John Trevor" not "john_trevor@abc.com" So when I send out an email to John obviously it gets bounced back becuase there is no valid email address. Hope I made the question little more clearer.

Thanks
0
 

Author Comment

by:wallstreetx
ID: 20846398
However, if I reply all, emails are correct but than I get server error saying "too many emails" I want to able to copy these email addresses and divide them into multiple batches. To do so, I need to import/copy these email addresses into excel or make a new Outlook Distribution list???
0
Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

 
LVL 76

Expert Comment

by:David Lee
ID: 20854292
How about creating a contact for each email address?  Would that work?
0
 

Author Comment

by:wallstreetx
ID: 20904088
Yes, that's a possibility but that will take a while. I must have over 1000 contacts and adding each will be tedious and time consuming. There's got be a way to copy all email addresses or import all email addresses into outlook distribution list or a new contact.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 20906343
Sorry, I wasn't clear.  I was asking if it'd be okay for a scripted solution to create a contact for each email address it extracts as opposed to entering them in a spreadsheet or distribution list.
0
 

Author Comment

by:wallstreetx
ID: 20919504
need the script to do that
0
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 20923457
I was waiting for you to respond and let me know that the approach I proposed was acceptable.  Here's the code for doing this.  Follow these instructions to use set up and use this.

1.  Open Outlook.
2.  Click Tools->Macro->Visual Basic Editor.  You should now be looking at the code editor.
3.  If it's not already expanded, expand Modules.  Then click on Module1.
4.  Copy the code below and paste it into the code window.
5.  Close the code window.
6.  Check that the macro appears.  Click Tools->Macro->Macros.  Make sure that AutoAddContact appears in the list of available macros.
7.  Go to the folder containing the messages you want to make contacts for.
8.  Select all the messages you want to turn into contacts.
9.  Click Tools->Macro->Macros, select AutoAddContact, and click Run.
10.  A dialog-box will pop up saying that an application is trying to access your email and asking for permission to allow it to do so.  Check "Allow access for" and change the time to 5 minutes (that should be long enough to process even a large number of selected messages).  The macro will now loop through the selected messages and make a contact item for each one that doesn't already exist.  Remember that the only relevant contact item fields that it can fill in are the FullName and EmailAddress, the only contact related fields in an email.

As requested, this version only adds the addresses from the CC line of the selected messages.  I can change that if you want.
Sub AutoAddContact()
    Dim olkContacts As MAPIFolder, _
        olkContact As ContactItem, _
        olkSelected As Selection, _
        olkItem As Object, _
        olkRecip As Recipient, _
        strAddress As String
    Set olkSelected = Application.ActiveExplorer.Selection
    If olkSelected.Count > 0 Then
        For Each olkItem In olkSelected
            If olkItem.Class = olMail Then
                Set olkContacts = Application.Session.GetDefaultFolder(olFolderContacts)
                For Each olkRecip In olkItem.Recipients
                    If olkRecip.Type = olCC Then
                        Set olkContact = olkContacts.Items.Find("[FullName] = " & Chr(34) & olkRecip.Name & Chr(34))
                        If TypeName(olkContact) = "Nothing" Then
                            Set olkContact = Application.CreateItem(olContactItem)
                            Set objReply = olkItem.Reply
                            Set olkRecip = objReply.Recipients.Item(1)
                            If Err = 0 Then
                                strAddress = olkRecip.Address
                                If strAddress = "" Then
                                    strAddress = olkRecip.Name
                                End If
                            End If
                            With olkContact
                                .Email1Address = strAddress
                                .FullName = olkItem.SenderName
                                .Body = "Record created automatically on " & Date & " at " & Time & " by BlueDevilFan's script."
                                .Save
                            End With
                        End If
                    End If
                Next
            End If
        Next
    End If
    Set olkContact = Nothing
    Set olkContacts = Nothing
    Set olkSelected = Nothing
    Set olkItem = Nothing
    Set objReply = Nothing
    Set olkRecip = Nothing
End Sub

Open in new window

0

Featured Post

Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
There’s hardly a doubt that Business Communication is indispensable for both enterprises and small businesses, and if there is an email system outage owing to Exchange server failure, it definitely results in loss of productivity.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question