?
Solved

Change phone number format

Posted on 2008-06-18
3
Medium Priority
?
714 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
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.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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 …
Suggested Courses

762 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