?
Solved

Changing all outlook contacts for international calling

Posted on 2011-10-05
7
Medium Priority
?
674 Views
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.
0
Comment
Question by:JoMar
  • 3
  • 2
  • 2
7 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 36920545
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.
0
 

Author Comment

by:JoMar
ID: 36925731
That would be great, thanks.
0
 
LVL 76

Accepted Solution

by:
David Lee earned 1600 total points
ID: 36926974
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"
Else
	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)
				olkCon.Save
			End If
		Next
		MsgBox "Finished!",vbInformation+vbOKOnly,"Fix Phone Numbers"
	Else
		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
    	Else
    		FixNumber = strNumber
    	End If
    Else
    	FixNumber = strNumber
    End If
End Function

Open in new window

0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 8

Assisted Solution

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

Expert Comment

by:Amit Khilnaney
ID: 36928039
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.
0
 

Author Closing Comment

by:JoMar
ID: 36993410
Thank you for the answers - this worked great
0
 
LVL 76

Expert Comment

by:David Lee
ID: 36993636
You're welcome!
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

850 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