• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

How do I change the phone number display format for all contacts at once

Hello,


I am having a similar issue with inconsistencies across my outlook contacts. I switched to a new blackberry that is registered in BES and when I activated the new device all of my contacts phone numbers got switched in both Outlook and on the device from (XXX) XXX-XXXX to XXXXXXXXXX. I found the following script  

 
Sub FixFileAsAddress()
    Dim olkContact As Outlook.ContactItem
    For Each olkContact In Application.ActiveExplorer.Selection
        With olkContact
            'Change the following line as needed
            .FileAs = .FirstName & " " & .LastName
            .Save
        End With
    Next
    Set olkContact = Nothing
End Sub

Open in new window


and would like to know how I could modify it to change all of my contacts back to the original formatting, (XXX) XXX-XXXX in outlook. Thank you in advance
0
PssTech
Asked:
PssTech
  • 2
1 Solution
 
MuffyBunnyCommented:
For Each olkContact In Application.ActiveExplorer.Selection
	With olkContact
		'Change the following line as needed
		.PrimaryTelephoneNumber = "(" & Left(.PrimaryTelephoneNumber,3) & ") " & Mid(.PrimaryTelephoneNumber,4,3) & "-" & Right(.PrimaryTelephoneNumber,4)
		.Save
	End With
Next

Open in new window

0
 
MuffyBunnyCommented:
By the way, the list of ContactItem methods and properties is here:

http://msdn.microsoft.com/en-us/library/bb176651%28v=office.12%29.aspx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now