move phone numbers from company field to business field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello-

I need to move the phone numbers from the 'company' field to the 'business'
field for approximately 800 contacts.

not all contacts have a number in the 'company' field.

the company field should be blank after the move.

please help.

Thanks,

Tyson
 
Am Thu, 8 Jun 2006 19:27:01 -0700 schrieb Tyson:

Tyson, this sample should do it:

Public Sub ExportContactsAsVCard()
Dim obj As Object
Dim Contact as Outlook.ContactItem
Dim Items As Outlook.Items

Set Items = Application.Session.GetDefaultFolder(olFolderContacts).Items
For Each obj In Items
If TypeOf obj Is Outlook.ContactItem Then
Set Contact=obj
Contact.BusinessTelephoneNumber=Contact.CompanyMainTelephoneNumber
Contact.CompanyMainTelephoneNumber=vbNullString
Contact.Save
End If
Next
End Sub
 
Michael-

Thanks for the code. Unfortunately, I forgot to mention that some contacts
already have a number in the 'business phone' field - this code overwrites
those numbers when the 'company phone' field is blank.

How to check for that before overwriting?

Tyson
 
Back
Top