Changing all outlook contacts for international calling

Posted on 2011-10-05
Last Modified: 2012-05-12
We are opening an international location so I have users, that were in the US, that are now traveling to Europe.  When they try to make a call using the contact that is in Outlook, it won't go because they are calling from Europe and the number is in US format.  In Outlook, I can go into each contact and double click on the phone number, make sure the location is United States and the area code is on the area code line, click ok and it changes from (123) 456-7890 to +1 (123) 456-7890, which enables people calling from Europe, or the US, to call the correct number.  One of my users uses a MacBook and the Outlook for Mac doesn't seem to have that option.
First part of question: Is there a way to do a mass change on all your contacts in Outlook to add the +1 to the number before the area code?
Second part of question: Is there a way to change contacts using Outlook for Mac to add the +1 to the number before the area code?
Thanks in advance.
Question by:JoMar
    LVL 76

    Expert Comment

    by:David Lee
    Hi, JoMar.

    I cannot answer the Mac portion of your question.  I can however answer the PC portion.  I can add a +1 to all phone numbers on all contacts with a simple bit of scripting.  If that's acceptable, then let me know and I'll post the script and instructions for using it.

    Author Comment

    That would be great, thanks.
    LVL 76

    Accepted Solution

    Here's the code.  Follow these instructions to use it.

    1.  Launch Notepad.
    2.  Copy the code below and paste it into Notepad.
    3.  Save the file.  You can name it anything you like, just make sure the extension is .vbs
    4.  Launch Outlook.
    5.  Select a Contacts folder.
    6.  Run the script by double-clicking it in explorer.

    The script will read all the contacts in the folder.  For each contact it will add a +1 to the number in all the typically used telephone number fields.  There are more fields, but they're rarely used.

    To be safe I recommend you test it on a folder with a couple of contacts before running it against your main contacts folder.  That way you can see what it does with very little risk.
    Dim olkApp, olkFld, olkCon
    Set olkApp = GetObject(,"Outlook.Application")
    If TypeName(olkApp) = "Nothing" Then
    	MsgBox "Outlook has to be open for this script to work." & vbCrLf & "Please launch Outlook and then run the script again.",vbCritical+vbOKOnly,"Fix Phone Numbers - Error"
    	Set olkFld = olkApp.ActiveExplorer.CurrentFolder
    	If olkfld.DefaultItemType = 2 Then
    		For Each olkCon In olkFld.items
    			If olkCon.Class = 40 then
    				olkCon.Business2TelephoneNumber = FixNumber(olkCon.Business2TelephoneNumber)				
    				olkCon.BusinessTelephoneNumber = FixNumber(olkCon.BusinessTelephoneNumber)
    				olkCon.BusinessFaxNumber = FixNumber(olkCon.BusinessFaxNumber)
    				olkCon.CompanyMainTelephoneNumber = FixNumber(olkCon.CompanyMainTelephoneNumber)
    				olkCon.Home2TelephoneNumber = FixNumber(olkCon.Home2TelephoneNumber)
    				olkCon.HomeTelephoneNumber = FixNumber(olkCon.HomeTelephoneNumber)
    				olkCon.HomeFaxNumber = FixNumber(olkCon.HomeFaxNumber)
    				olkCon.MobileTelephoneNumber = FixNumber(olkCon.MobileTelephoneNumber)
    				olkCon.OtherTelephoneNumber = FixNumber(olkCon.OtherTelephoneNumber)
    				olkCon.OtherFaxNumber = FixNumber(olkCon.OtherTelephoneNumber)
    			End If
    		MsgBox "Finished!",vbInformation+vbOKOnly,"Fix Phone Numbers"
    		MsgBox "This script will only work against a contacts folder." & vbCrLf & "Please select a contacts folder and run the script again.",vbCritical+vbOKOnly,"Fix Phone Numbers - Error"
    	End If
    	Set olkCon = Nothing
    	Set olkFld = Nothing
    	Set olkApp = Nothing
    End If
    Function FixNumber(strNumber)
        If strNumber <> "" Then
        	If Left(strNumber,2) <> "+1" Then
        		FixNumber = "+1 " & strNumber
        		FixNumber = strNumber
        	End If
        	FixNumber = strNumber
        End If
    End Function

    Open in new window

    LVL 8

    Assisted Solution

    by:Amit Khilnaney
    Export Contacts in a CSV file. Open with excel. Use concatenate function to add +1 and then re-import the address book.
    LVL 8

    Expert Comment

    by:Amit Khilnaney
    Above solution will got with Mac As well. U just need a spreadsheet program as concatenate function is a very basic function avail in most spreadsheet programs.

    Author Closing Comment

    Thank you for the answers - this worked great
    LVL 76

    Expert Comment

    by:David Lee
    You're welcome!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    delegate permissions command 4 31
    Please help email to staff 2 34
    pop/imap email 32 33
    Can't open mailaccount with ost. file 8 25
    Get an idea of what you should include in an email disclaimer with these Top 5 email disclaimer tips.
    Outlook Free & Paid Tools
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    6 Experts available now in Live!

    Get 1:1 Help Now