Skip to main content

How to remove country code from phone numbers of contacts in Outlook?

Author: Kelly Last Modified: 2016-12-21

In the Contact window, when you click the Business/Home/Fax/Mobile field button before the phone numbers to active the Check Phone Number dialog box as below screenshot shown, the country code will be added before the phone numbers automatically. But, sometimes the country code may be not necessary at all, and you want to remove it from all phone numbers, how could you deal with it? Try below solutions:

Office Tab - Enable Tabbed Editing and Browsing in Microsoft Office, Making Work a Breeze
Unlock Kutools for Outlook's free version now and enjoy over 70 features with unlimited access forever
Boost your Outlook 2021 - 2010 or Outlook 365 with these advanced features. Enjoy 70+ powerful features and elevate your email experience!

arrow blue right bubbleRemove country code from phone number of a contact

If you just need to remove the country code from one phone number of a contact, you can manually delete it as follows:

1. In the People (or Contacts) view, click View > Change View > Phone. See screenshot:

2. Double click to open the contact whose phone number you will remove country number from.

3. In the opening Contact window, remove the plus sign and country code from the specified phone in the Phone Numbers section, and then click Contact > Save & Close.

So far, the country code has been removed from the specified phone number as below screenshot shown:


arrow blue right bubbleRemove country code from phone numbers of contacts with VBA

If you need to remove the country code from all phone numbers of all contacts in Outlook, I recommend a VBA to handle it easily.

1. In the People (or Contacts) view, open the contact folder where you will remove the country code from all contacts.

2. Press Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window.

3. Click Insert > Module, and then paste below VBA code into the new opening Module script.

VBA: Remove Country code from all phone numbers of all contacts

Sub FixPhoneFormat()

 Dim oFolder As MAPIFolder
Set oFolder = Application.ActiveExplorer.CurrentFolder

 If Left(UCase(oFolder.DefaultMessageClass), 11) <> "IPM.CONTACT" Then
MsgBox "You need to select a Contacts folder", vbExclamation
Exit Sub
End If

Dim nCounter As Integer
nCounter = 0

Dim oItem
For Each oItem In oFolder.Items
Dim oContact As ContactItem

          If TypeName(oItem) <> "DistListItem" Then
Set oContact = oItem
With oContact
.AssistantTelephoneNumber = FixFormatUSPhone(.AssistantTelephoneNumber)
.Business2TelephoneNumber = FixFormatUSPhone(.Business2TelephoneNumber)
.BusinessFaxNumber = FixFormatUSPhone(.BusinessFaxNumber)
.BusinessTelephoneNumber = FixFormatUSPhone(.BusinessTelephoneNumber)
.CallbackTelephoneNumber = FixFormatUSPhone(.CallbackTelephoneNumber)
.CarTelephoneNumber = FixFormatUSPhone(.CarTelephoneNumber)
.CompanyMainTelephoneNumber = FixFormatUSPhone(.CompanyMainTelephoneNumber)
.Home2TelephoneNumber = FixFormatUSPhone(.Home2TelephoneNumber)
.HomeFaxNumber = FixFormatUSPhone(.HomeFaxNumber)
.HomeTelephoneNumber = FixFormatUSPhone(.HomeTelephoneNumber)
.ISDNNumber = FixFormatUSPhone(.ISDNNumber)
.MobileTelephoneNumber = FixFormatUSPhone(.MobileTelephoneNumber)
.OtherFaxNumber = FixFormatUSPhone(.OtherFaxNumber)
.OtherTelephoneNumber = FixFormatUSPhone(.OtherTelephoneNumber)
.PagerNumber = FixFormatUSPhone(.PagerNumber)
.PrimaryTelephoneNumber = FixFormatUSPhone(.PrimaryTelephoneNumber)
.RadioTelephoneNumber = FixFormatUSPhone(.RadioTelephoneNumber)
.TelexNumber = FixFormatUSPhone(.TelexNumber)
.TTYTDDTelephoneNumber = FixFormatUSPhone(.TTYTDDTelephoneNumber)

.Save

nCounter = nCounter + 1
End With
End If
Next

MsgBox nCounter & " contacts processed.", vbInformation

End Sub

Private Function FixFormatUSPhone(Phone As String) As String

Phone = Trim(Phone)
FixFormatUSPhone = Phone
If Phone = "" Then Exit Function
Dim prefix As String
prefix = Left(Phone, 1)

' Configured for US
' Enter the correct prefix here
Do While (prefix = "+" Or prefix = "1")

' if the prefix is 2 digits, change to 4;
' if 3 digits, change to 5
Phone = Mid(Phone, 3)
prefix = Left(Phone, 1)
Loop

' After we clean up the country code, we remove non-numeric characters
' Can be tweaked to change formatting, ie: change 202.555.1212 to 202-555-1212

 Phone = Replace(Phone, "(", "")
Phone = Replace(Phone, ")", "")
Phone = Replace(Phone, ".", "")
Phone = Replace(Phone, " ", "")
Phone = Replace(Phone, "-", "")

 FixFormatUSPhone = Phone

End Function

4. Press F5 key or click the Run button to run this VBA.

5. And then a dialog box pops out and show you how many contacts have been processed, please click the OK button to close it.

Now, you will see the country code has been removed from all kinds of phone numbers from all contacts. See screenshot:


arrow blue right bubbleRelated Articles


Best Office Productivity Tools

Breaking News: Kutools for Outlook Launches Free Version!

Experience the all-new Kutools for Outlook FREE version with 70+ incredible features, yours to use FOREVER! Click to download now!

🤖 Kutools AI : Instant pro emails with AI magic--one-click to genius replies, perfect tone, multilingual mastery. Transform emailing effortlessly! ...

📧 Email Automation: Auto Reply (Available for POP and IMAP)  /  Schedule Send Emails  /  Auto CC/BCC by Rules When Sending Email  /  Auto Forward (Advanced Rules)   /  Auto Add Greeting   /  Automatically Split Multi-Recipient Emails into Individual Messages ...

📨 Email Management: Recall Emails  /  Block Scam Emails by Subjects and Others  /  Delete Duplicate Emails  /  Advanced Search  /  Consolidate Folders ...

📁 Attachments ProBatch Save  /  Batch Detach  /  Batch Compress  /  Auto Save   /  Auto Detach  /  Auto Compress ...

🌟 Interface Magic: 😊More Pretty and Cool Emojis   /  Remind you when important emails come  /  Minimize Outlook Instead of Closing ...

👍 One-click Wonders: Reply All with Incoming Attachments  /   Anti-Phishing Emails  /  🕘Show Sender's Time Zone ...

👩🏼‍🤝‍👩🏻 Contacts & Calendar: Batch Add Contacts From Selected Emails  /  Split a Contact Group to Individual Groups  /  Remove Birthday Reminders ...

Instantly unlock Kutools for Outlook with a single click—permanently free. Don't wait, download now and boost your efficiency!

kutools for outlook features1 kutools for outlook features2
 

 

 

Comments (2)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
+91 60024 92129, +91 60065 92433, +91 6202 829 537, +91 6203 755 915, +91 6204 259 651, +91 6207 216 259, +91 6209 023 134, +91 6232 456 267, +91 6235 691 325, +91 6263 257 978, +91 6263 845 800, +91 6266 107 625, +91 6266 376 594, +91 6266 384 728, +91 6280 820 003, +91 6281 474 533, +91 6284 313 048, +91 6289 752 279, +91 6295 233 987, +91 6305 544 139, +91 6305 562 486, +91 6306 311 209, +91 6306 386 697, +91 6307 439 745, +91 6352 442 999, +91 6353 295 836, +91 6354 886 422, +91 6355 080 896, +91 6355 150 955, +91 6358 267 338, +91 6360 945 697, +91 6360 971 578, +91 6360 996 047, +91 6361 017 625, +91 6361 161 705, +91 6362 272 097, +91 6362 416 590, +91 6362 931 344, +91 6363 514 848, +91 6364 472 912, +91 6366 080 543, +91 6366 862 676, +91 6370 377 433, +91 6375 291 478, +91 6377 101 680, +91 6377 234 266, +91 6377 787 860, +91 6379 731 040, +91 6379 898 610, +91 6380 895 878, +91 6382 288 674, +91 6382 538 352, +91 6383 599 030, +91 6390 226 455, +91 6396 147 183, +91 6396 898 290, +91 6396 913 882, +91 70026 40668, +91 70030 97346, +91 70037 91315, +91 70041 99885, +91 70077 00459, +91 70088 43393, +91 70139 18583, +91 70151 73797, +91 70162 80468, +91 70163 84772, +91 70215 25584, +91 70223 73946, +91 70223 86042, +91 70261 00777, +91 70281 24252, +91 70312 12290, +91 70338 71811, +91 70348 41296, +91 70415 89862, +91 70483 07028, +91 70564 29288, +91 70578 80895, +91 70611 23745, +91 70619 46794, +91 70635 71388, +91 70661 15004, +91 70684 42618, +91 70692 27254, +91 70694 59872, +91 70819 32191, +91 70926 80424, +91 70969 19196, +91 70972 88194, +91 72000 70714, +91 72005 08588, +91 72044 36977, +91 72044 43276, +91 72049 22644, +91 72054 75784, +91 72075 24526, +91 72094 15297, +91 72183 02668, +91 72230 46597, +91 72249 40943, +91 72328 52648, +91 72400 41795, +91 72492 19541, +91 72591 96605, +91 72678 35455, +91 72749 39201, +91 72819 41453, +91 72838 35806, +91 72879 76908, +91 72920 57758, +91 72970 86260, +91 73057 12295, +91 73071 40929, +91 73077 05470, +91 73199 30398, +91 73239 20547, +91 73381 01005, +91 73386 35465, +91 73389 98301, +91 73…
This comment was minimized by the moderator on the site
this works well, although i would like to understand how it works more as it puts brackets, where i dont really need then. I am in Australia.
My other issue is that somehow, somewhere, it is reverting back to all having the country code
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations