Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

Mass change contacts mail server

I have three state clients that are getting new mail server address changes. Their mail server is changing from xxx.xxx.xxx.gov to xxxx.xxxxxx.org. Being  state enitites they have massive amounts of addresses in their contact folders. Is their a simple tool that can make these changes and minimize the pain (whining)? About 200 persons involved in this and each has several hundred contacts with the old extension
  • 2
1 Solution
Chris BottomleyCommented:
The following snippet looks for all contacts with @fred.com and replaces with @fred.org.

Replacing @fred with your required domain should do the job for you ... but ask if you need help.

It is an outlook macro:
To Create a macro:

Alt + F11 to open the macro editor
     Insert | Module to insert a code module into the project
     In the project tree select the module.
     Insert the required macro(s) into the selected module, ('Module1' or similar)
Close the Visual Basic Editor.

Check Security as appropriate:

In the application select Tools | Macro | Security
Select Medium
Select OK

To run a macro:

Alt + F8
Select the macro
Select 'Run'

Sub update_Contacts()
Dim con As ContactItem
Dim addy As Object
    For Each con In Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items
        con.Email1Address = Replace(con.Email1Address, "@fred.com", "@fred.org")
        con.Email1DisplayName = Replace(con.Email1DisplayName, "@fred.com", "@fred.org")
        con.Email2Address = Replace(con.Email2Address, "@fred.com", "@fred.org")
        con.Email2DisplayName = Replace(con.Email2DisplayName, "@fred.com", "@fred.org")
        con.Email3Address = Replace(con.Email3Address, "@fred.com", "@fred.org")
        con.Email3DisplayName = Replace(con.Email3DisplayName, "@fred.com", "@fred.org")
End Sub

Open in new window

warsawtechConsultantAuthor Commented:
Thanks....a dream come true!!!!
Chris BottomleyCommented:
Glad to have been of help, and thanks for the grade.


Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now