Solved

Change phone number format

Posted on 2008-06-18
3
708 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
3 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 500 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
Find out what you should include to make the best professional email signature for your organization.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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