Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Apr 2010
    Location
    Welkom, South Africa
    Posts
    53
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Email address format change

    I am doing some email database management. I have a long list of addresses in hyperlink (?) format. I.e. the address is shown as "Peter". If you hover the mouse over "Peter" it shows the address as peter@abs.com. How can I change this into the "normal" format i.e. peter@abs.com ? I need some automatic process because of the number of addresses involved. Is there a way to do this is Excel?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Where is the list of addresses (e.g., in the To box, in an HTML-format email message in Outlook, in Excel)?

  3. #3
    Star Lounger
    Join Date
    Apr 2010
    Location
    Welkom, South Africa
    Posts
    53
    Thanks
    9
    Thanked 0 Times in 0 Posts
    The list is currently in a Word document.

  4. #4
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,414
    Thanks
    33
    Thanked 195 Times in 175 Posts
    I may be stupid, but both your peter@abs.com's look identical!
    BATcher

    Time prevents everything happening all at once...

  5. #5
    Star Lounger
    Join Date
    Apr 2010
    Location
    Welkom, South Africa
    Posts
    53
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Let me explain again: some addresses are in the normal abc@def.com format. These are fine. The others are listed as eg. "Peter". This name is then a hypelink (?) to peter@abs.com If I click on "Peter" a mail is created for the address peter@abs.com I want to change all the "Peter" type addresses to the normal abc@def.com format. Hope that clears it up.

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    You could try something like this:

    Code:
    Sub EmailAddressToFieldResult()
    Dim hlf As Word.Field, strAdd As String
    For Each hlf In ActiveDocument.Content.Fields
        If hlf.Type = wdFieldHyperlink Then
            strAdd = Mid(hlf.Code, InStr(1, hlf.Code, """", vbBinaryCompare) + 1)
            strAdd = Left(strAdd, InStr(1, strAdd, """", vbBinaryCompare) - 1)
            If hlf.Result.Text <> strAdd Then
                hlf.Result.Text = strAdd
            End If
        End If
    Next
    End Sub

Posting Permissions

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