Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jan 2002
    Location
    Duluth, Minnesota, USA
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mass Email Changes (Outlook 2000/SR1)

    I have a friend who has about 350 contacts for a particular company. Recently, this company changed their domain name thus all email addresses need to be changed (i.e., lmb@hotmail.com to lmb@newname.com). Is there any way to do a mass/global search/replace to change just the portion of the email address that changed without opening up each contact and manually make the change one at a time?

    Whatever help you can supply would be greatly appreciated. Thanks.
    LMB

  2. #2
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Roanoke area, Virginia, USA
    Posts
    3,729
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mass Email Changes (Outlook 2000/SR1)

    unfortunately not. this is one change that even my favorite trick of group by won't work <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

    the easiest way to to export to excel, use excel's search and replace to make the global change then import.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Mass Email Changes (Outlook 2000/SR1)

    In theory, the following procedure should work for all SMTP addresses, but, it trashes any custom display name (any display name that does not consist of the full name plua, in parentheses, (E-mail)). I can't figure out why, but I can say that testing it on my real contacts folder was not the best idea. <img src=/S/smile.gif border=0 alt=smile width=15 height=15> By the way, if you don't build the address this way, and simply assign a new Email1Address, the display name is changed to the same as the Address. If you like it that way, you can simplify the code a lot.
    <pre>Sub SwapDomain()
    'Replaces domain portion of e-mail addresses in a Contacts folder
    'Jefferson Scher 2002-01-11
    Dim strOldDomain As String, strNewDomain As String
    strOldDomain = "@" & InputBox("Enter domain to replace (the old domain)", , "blahblah.com")
    If Trim(strOldDomain) = "@" Then Exit Sub
    enterNew:
    strNewDomain = "@" & InputBox("Enter domain to substitute (the new domain)", , "heyhey.com")
    If Trim(strNewDomain) = "@" Then Exit Sub
    If InStr(1, strNewDomain, " ") Then
    MsgBox "No spaces allowed in e-mail addresses."
    GoTo enterNew
    End If
    If MsgBox("Change " & strOldDomain & " to " & strNewDomain & "?", _
    vbQuestion + vbYesNo) = vbNo Then Exit Sub

    Dim aContact As ContactItem
    'no error trapping for non-Contacts folder; sorry
    For Each aContact In ActiveExplorer.CurrentFolder.Items
    With aContact
    If (InStr(1, .Email1Address, strOldDomain, vbTextCompare) > 0) And _
    (.Email1AddressType = "SMTP") Then
    MsgBox "Updating " & .Email1DisplayName 'why is this wrong??
    .Email1Address = .Email1DisplayName & " [" & _
    .Email1AddressType & ":" & Replace(.Email1Address, strOldDomain, _
    strNewDomain, , , vbTextCompare) & "]"
    .Save
    End If
    If (InStr(1, .Email2Address, strOldDomain, vbTextCompare) > 0) And _
    (.Email2AddressType = "SMTP") Then
    MsgBox "Updating " & .Email2DisplayName 'why is this wrong??
    .Email2Address = .Email2DisplayName & " [" & _
    .Email2AddressType & ":" & Replace(.Email2Address, strOldDomain, _
    strNewDomain, , , vbTextCompare) & "]"
    .Save
    End If
    If (InStr(1, .Email3Address, strOldDomain, vbTextCompare) > 0) And _
    (.Email3AddressType = "SMTP") Then
    MsgBox "Updating " & .Email3DisplayName 'why is this wrong??
    .Email3Address = .Email3DisplayName & " [" & _
    .Email3AddressType & ":" & Replace(.Email3Address, strOldDomain, _
    strNewDomain, , , vbTextCompare) & "]"
    .Save
    End If
    End With
    Next
    MsgBox "Done!"
    End Sub</pre>

    Maybe this will help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •