a short code to delete the data from all contacts

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

Guest

I have about 600 contacts, and about 599 of them have the field "Business
Fax" which incorrectly contains the data "(ext. 5255)". Rather than having
to manually change every one of these, is there a simple code I could run
that would run through all the contacts in the current view and delete the
data in the field "Business Fax" if it matches (ext. 5255)?
Thanks,
Charlie
 
Hi Charlie,

this should help you:

Public Sub DoSomething()
Dim colItems As Outlook.Items
Dim obj As Object

Set colItems = Application.ActiveExplorer.CurrentFolder.Items
For Each obj In colItems
If TypeOf obj Is Outlook.ContactItem Then
With obj
If .BusinessFaxNumber="(ext. 5255)" Then
.BusinessFaxNumber=vbNullString
.Save
Endif
End With
End If
Next
End Sub
 
Back
Top