View Single Post
 
Old 03-02-2013, 05:35 AM
niton niton is offline Windows 7 64bit Office 2010 64bit
Competent Performer
 
Join Date: Jul 2012
Posts: 102
niton is on a distinguished road
Default VBA Solution

http://msdn.microsoft.com/en-us/libr...ctEditingMacro

Code:
Sub CompanyChange_All()
    Dim ContactsFolder As Folder
    Set ContactsFolder = Session.GetDefaultFolder(olFolderContacts)
    MsgBox ("Contacts Found:" & ContactsFolder.Items.Count)
    
    Dim Contact As ContactItem

    For Each Contact In ContactsFolder.Items
        If Contact.CompanyName = "Example Systems" Then      
            Contact.CompanyName = "Example Networks"
            Contact.Save
            Debug.Print "Changed: " & Contact.FullName
        End If
    Next
End Sub
******
If not in the default folder, "already in a separate contact set", try this UNTESTED code on a selection of test items.

Code:
Sub CompanyChange_Selection()
     
    Dim Contact As Object

    For Each Contact In ActiveExplorer.Selection

	If Contact.Class = olContact Then
	    If Contact.CompanyName = "Example Systems" Then
            	Contact.CompanyName = "Example Networks"
            	Contact.Save
            	Debug.Print "Changed: " & Contact.FullName
            End If
        End If
    Next
End Sub
If you are unfamiliar with VBA see here http://www.slipstick.com/developer/h...ks-vba-editor/

You will find information about:
- macro security settings
- where to put the code
- how to create a button


*******************
Consider rating the thread by going to the "Rate Thread" dropdown.
Reply With Quote