Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Outlook/Contact Area Codes 1

Status
Not open for further replies.

LarryDeLaruelle

Technical User
May 19, 2000
1,055
US
The local area code is being changed and we are looking for a VB (or other) solution to make the necessary changes to the clients' Outlook Contact lists.

Is it possible to use VB to open a contact list, parse the phone number and, based on Area Code and Prefix, modify the existing area code to the new area code?

We are using Exchange Server 5.5, a mix of Outlook 98 and 2000 and all user machines are NT4.0.

Appreciate any advice you all can provide. Thanks. Larry De Laruelle
larry1de@yahoo.com

 
If you are referring to the contacts stored in the default Outlook contacts folder, you can use the following:

Dim oNS As Outlook.NameSpace
Dim oFolder As Outlook.MAPIFolder
Dim oItem As Outlook.ContactItem
Dim sPhone As String

Set oNS = Application.GetNamespace("MAPI")
Set oFolder = oNS.GetDefaultFolder(olFolderContacts)

For Each oItem In oFolder.Items
sPhone = oItem.BusinessTelephoneNumber
If Left(sPhone, 5) = "(904)" Then
oItem.BusinessTelephoneNumber = "(000)" & Mid(sPhone, 6)
oItem.Save
End If
Next

You'll also need to reference several of the other phone-related properties. You can find a list here Jon Hawkins
 
Thanks Jon. I'll give that a try. Larry De Laruelle
ldelaruelle@familychildrenscenter.org

 
Larry,
Our friend, Jon Hawkins, has provided you, and others such as me, with the benefit of his years of experience and skill. Such a response deserves recognition.

Here at Tek-Tips, we reward such contributions with a well deserved STAR. It is a small token of recognition for a job well done.

Thanx, Jon! :) Skip,
metzgsk@voughtaircraft.com
 
Skip:

Not a problem and I usually do give stars. Just wanted to see it work first. Larry De Laruelle
ldelaruelle@familychildrenscenter.org

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top