Skip to main content

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

Author Kelly Last modified

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


Remove 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:

doc-contacts-remove-country-code-1

2. Double-click to open the contact whose phone number you want to remove the country code from.

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

doc-contacts-remove-country-code-2

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

doc-contacts-remove-country-code-4


Remove 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, you can apply a VBA to handle it easily.

1. In the "People" (or "Contacts") view, open the contact folder where you want to 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 the following 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)

Do While (prefix = "+" Or prefix = "1")
Phone = Mid(Phone, 3)
prefix = Left(Phone, 1)
Loop

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

FixFormatUSPhone = Phone

End Function

4. Press "F5" or click the "Run" button to execute the VBA.

5. Then a dialog box pops up showing how many contacts have been processed. Please click the "OK" button to close it.

doc-contacts-remove-country-code-5

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

doc-contacts-remove-country-code-6


Related Articles


Best Office Productivity Tools

Breaking News: Kutools for Outlook Launches Free Version!

Experience the all-new Kutools for Outlook with 100+ incredible features! Click to download now!

πŸ€– Kutools AI : Uses advanced AI technology to handle emails effortlessly, including replying, summarizing, optimizing, extending, translating, and composing emails.

πŸ“§ 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 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 ...

Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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

kutools for outlook features1 kutools for outlook features2