[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Change phone number format

Posted on 2008-06-18
3
Medium Priority
?
715 Views
Last Modified: 2013-12-25
I have all my phone numbers in the format:
+44 7738888888

But i need them to be as follows:
+44 (0) 7738888888
is there a VB script that will do this on my busness phone  / home Phone numbers.

I have 8 PCs to run this on so an script that can run on all the PCs with alittle doctoring would be a great help.
0
Comment
Question by:sifenwick
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 2000 total points
ID: 21818581
try something like this, adapted from bluedevilfan. I'd save a copy of the address book first if I were you.
Private Sub updateContacts()
    Dim MyFolder As Outlook.MAPIFolder, _
        MyContact As Object
    Set MyFolder = Session.GetDefaultFolder(olFolderContacts)
    ' Loop through all of the items in the folder. And looks for area code that does not have (0), for example +670 723-3361 should be expressed it as  +670 (0) 723-3361
    For Each MyContact In MyFolder.Items
        If MyContact.Class = olContact Then
            If not InStr(MyContact.BusinessTelephoneNumber, "(0)") Then
                MyContact.MobileTelephoneNumber = Left(MyContact.BusinessTelephoneNumber, 4) & "(0) " & Right(MyContact.BusinessTelephoneNumber,len(MyContact.BusinessTelephoneNumber)-4)
                MyContact.Save
            End If
        End If
    Next
    Set MyContact = Nothing
    Set MyFolder = Nothing
End Sub

Open in new window

0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
This article describes how to import Lotus Notes Contacts into Outlook 2016, 2013, 2010 and 2007 etc. with a few manual steps. You can easily export and migrate Lotus Notes contacts into Microsoft Outlook without having to use any third party tools.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
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 …

650 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