Outlook 2007 - Phone Number Display In Contacts

N

NewtoExpressionWeb

We have an interesting outlook contact phone number display issue.

We have programmed our Phone and Modem settings to include rules for phone
number prefixes within our area code that require long distance information.
(1+areacode) When adding a new contact everything displays great. For
example.... 1 (999) 999-9999 Etc...

Existing contacts before the rules however, still display as either (999)
999-9999 or worse 999-9999. Opening the contact and clicking the phone
number button fixes it, but with some users having hundreds-thousands of
contacts that is kind of an un-reasonable approach. All contacts are stored
in Exchange as the back-end.

Funny note: If you click the "dial" button, the number dials correctly even
though the display is wrong.

Is there a way to have the contacts DISPLAY properly without having the
users edit each one? Will export, delete all, import work? What are the
chances for data loss doing that? (Some users have information in a LOT of
fields.)

Thanks in advance for any help...

D
 
M

Michal [Outlook MVP]

You can try the below macro. It worked ok for Polish users, I made necessary
changes to make it working with +1 prefix, but I didn't test it. So, first
better run it on a small number of temporary contacts.

Sub CountryPrefix()

Dim oFolder As MAPIFolder
Set oFolder = Application.ActiveExplorer.CurrentFolder
If Left(UCase(oFolder.DefaultMessageClass), 11) <> "IPM.CONTACT" Then
MsgBox "Select contact folder", vbExclamation
Exit Sub
End If

Dim nCounter As Integer
nCounter = 0

Dim oItem
For Each oItem In oFolder.Items
Dim oContact As ContactItem
Set oContact = oItem
If Not oContact Is Nothing Then
With oContact
.AssistantTelephoneNumber = AddPrefix(.AssistantTelephoneNumber)
.Business2TelephoneNumber = AddPrefix(.Business2TelephoneNumber)
.BusinessFaxNumber = AddPrefix(.BusinessFaxNumber)
.BusinessTelephoneNumber = AddPrefix(.BusinessTelephoneNumber)
.CallbackTelephoneNumber = AddPrefix(.CallbackTelephoneNumber)
.CarTelephoneNumber = AddPrefix(.CarTelephoneNumber)
.CompanyMainTelephoneNumber = AddPrefix(.CompanyMainTelephoneNumber)
.Home2TelephoneNumber = AddPrefix(.Home2TelephoneNumber)
.HomeFaxNumber = AddPrefix(.HomeFaxNumber)
.HomeTelephoneNumber = AddPrefix(.HomeTelephoneNumber)
.ISDNNumber = AddPrefix(.ISDNNumber)
.MobileTelephoneNumber = AddPrefix(.MobileTelephoneNumber)
.OtherFaxNumber = AddPrefix(.OtherFaxNumber)
.OtherTelephoneNumber = AddPrefix(.OtherTelephoneNumber)
.PagerNumber = AddPrefix(.PagerNumber)
.PrimaryTelephoneNumber = AddPrefix(.PrimaryTelephoneNumber)
.RadioTelephoneNumber = AddPrefix(.RadioTelephoneNumber)
.TelexNumber = AddPrefix(.TelexNumber)
.TTYTDDTelephoneNumber = AddPrefix(.TTYTDDTelephoneNumber)

.Save

nCounter = nCounter + 1
End With
End If
Next

MsgBox nCounter & " contacts processed.", vbInformation

End Sub

Private Function AddPrefix(strPhone As String) As String

AddPrefix = strPhone
strPhone = Trim(strPhone)

If strPhone = "" Then Exit Function
If Left(strPhone, 1) = "+" Then Exit Function
If Left(strPhone, 2) = "(+" Then Exit Function
If Left(strPhone, 2) = "00" Then Exit Function
If Left(strPhone, 3) = "(00" Then Exit Function
If Left(strPhone, 1) = "1" Then Exit Function
If Left(strPhone, 2) = "(1" Then Exit Function

AddPrefix = "1" + strPhone

End Function

--
Best regards,
Michal [Microsoft Outlook MVP]

http://www.codetwo.com
Share Outlook on the net without Exchange!
 
N

NewtoExpressionWeb

Hi Michal,

I appreciate your time on the macro, but I'm not sure that is going to do
what we wanted. We don't necessarily want to append a 1+ to all our
contacts. We only want that to happen if it's long distance based on the
phone/modem settings. (As outlook should on it's own, and does with new
entries.)

Michal said:
You can try the below macro. It worked ok for Polish users, I made necessary
changes to make it working with +1 prefix, but I didn't test it. So, first
better run it on a small number of temporary contacts.

Sub CountryPrefix()

Dim oFolder As MAPIFolder
Set oFolder = Application.ActiveExplorer.CurrentFolder
If Left(UCase(oFolder.DefaultMessageClass), 11) <> "IPM.CONTACT" Then
MsgBox "Select contact folder", vbExclamation
Exit Sub
End If

Dim nCounter As Integer
nCounter = 0

Dim oItem
For Each oItem In oFolder.Items
Dim oContact As ContactItem
Set oContact = oItem
If Not oContact Is Nothing Then
With oContact
.AssistantTelephoneNumber = AddPrefix(.AssistantTelephoneNumber)
.Business2TelephoneNumber = AddPrefix(.Business2TelephoneNumber)
.BusinessFaxNumber = AddPrefix(.BusinessFaxNumber)
.BusinessTelephoneNumber = AddPrefix(.BusinessTelephoneNumber)
.CallbackTelephoneNumber = AddPrefix(.CallbackTelephoneNumber)
.CarTelephoneNumber = AddPrefix(.CarTelephoneNumber)
.CompanyMainTelephoneNumber = AddPrefix(.CompanyMainTelephoneNumber)
.Home2TelephoneNumber = AddPrefix(.Home2TelephoneNumber)
.HomeFaxNumber = AddPrefix(.HomeFaxNumber)
.HomeTelephoneNumber = AddPrefix(.HomeTelephoneNumber)
.ISDNNumber = AddPrefix(.ISDNNumber)
.MobileTelephoneNumber = AddPrefix(.MobileTelephoneNumber)
.OtherFaxNumber = AddPrefix(.OtherFaxNumber)
.OtherTelephoneNumber = AddPrefix(.OtherTelephoneNumber)
.PagerNumber = AddPrefix(.PagerNumber)
.PrimaryTelephoneNumber = AddPrefix(.PrimaryTelephoneNumber)
.RadioTelephoneNumber = AddPrefix(.RadioTelephoneNumber)
.TelexNumber = AddPrefix(.TelexNumber)
.TTYTDDTelephoneNumber = AddPrefix(.TTYTDDTelephoneNumber)

.Save

nCounter = nCounter + 1
End With
End If
Next

MsgBox nCounter & " contacts processed.", vbInformation

End Sub

Private Function AddPrefix(strPhone As String) As String

AddPrefix = strPhone
strPhone = Trim(strPhone)

If strPhone = "" Then Exit Function
If Left(strPhone, 1) = "+" Then Exit Function
If Left(strPhone, 2) = "(+" Then Exit Function
If Left(strPhone, 2) = "00" Then Exit Function
If Left(strPhone, 3) = "(00" Then Exit Function
If Left(strPhone, 1) = "1" Then Exit Function
If Left(strPhone, 2) = "(1" Then Exit Function

AddPrefix = "1" + strPhone

End Function

--
Best regards,
Michal [Microsoft Outlook MVP]

http://www.codetwo.com
Share Outlook on the net without Exchange!


We have an interesting outlook contact phone number display issue.

We have programmed our Phone and Modem settings to include rules for phone
number prefixes within our area code that require long distance information.
(1+areacode) When adding a new contact everything displays great. For
example.... 1 (999) 999-9999 Etc...

Existing contacts before the rules however, still display as either (999)
999-9999 or worse 999-9999. Opening the contact and clicking the phone
number button fixes it, but with some users having hundreds-thousands of
contacts that is kind of an un-reasonable approach. All contacts are stored
in Exchange as the back-end.

Funny note: If you click the "dial" button, the number dials correctly even
though the display is wrong.

Is there a way to have the contacts DISPLAY properly without having the
users edit each one? Will export, delete all, import work? What are the
chances for data loss doing that? (Some users have information in a LOT of
fields.)

Thanks in advance for any help...

D
 
B

Brian Tillman

NewtoExpressionWeb said:
I appreciate your time on the macro, but I'm not sure that is going
to do what we wanted. We don't necessarily want to append a 1+ to
all our contacts. We only want that to happen if it's long distance
based on the phone/modem settings. (As outlook should on it's own,
and does with new entries.)

Outlook will always add "+1" (_not_ "1+") to phone numbers when your PC's
dialing and modem properties are correctly configured. It's standard
international phone number formatting and phone systems should be able to
handle it. Even for local phone numbers, it's possible to dial numbers in
international format.
 
N

NewtoExpressionWeb

I know this. What I am trying to convey is that our phone and modem settings
ARE CORRECT. And it WORKS FOR NEW CONTACTS. It DOES NOT display properly
for contacts that were ALREADY IN THE DATABASE prior to the phone and modem
entries.
 
B

Brian Tillman

NewtoExpressionWeb said:
I know this. What I am trying to convey is that our phone and modem
settings ARE CORRECT. And it WORKS FOR NEW CONTACTS. It DOES NOT
display properly for contacts that were ALREADY IN THE DATABASE prior
to the phone and modem entries.

I'll bet you imported those earlier contacts.

There are third-party tools that can make wholesale changes to your
contacts. See if something here helps:
http://www.slipstick.com/addins/contacts_phone.asp
 
N

NewtoExpressionWeb

They were not imported, they just existed before the prefix rules were added
to phone/modem settings.

I'll check out the utility.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top