2 Methods to Batch Change Multiple Hyperlinks’ Addresses in Your Outlook Email

For some reasons, you’ve inserted multiple hyperlinks to texts in your Outlook email. And some of them are linked to the same address. If you would like to batch change these hyperlinks’ addresses, you can use the methods introduced in this article.

For instance, you have composed an Outlook email, which has a lot of hyperlinks in the message body. Yet, afterwards, you discovered that an address is wrong. And many hyperlinks are using this address. Therefore, you need to batch change these hyperlinks’ addresses. In response to this problem, thereinafter, we’ll share 2 easy and quick approaches.Batch Change Multiple Hyperlinks' Addresses in Your Outlook Email

Method 1: Find and Replace Manually

  1. To begin with, in the opened email, press “Alt + F9” key buttons.
  2. Then, all the hyperlinks’ addresses will be shown directly.Show Hyperlinks
  3. Now, press “Ctrl + H” to bring out the “Find and Replace” dialog box.
  4. In this new dialog box, input the old hyperlink address in “Find what” box and new address in “Replace with” box.
  5. After that, click “Replace All” button.Find & Replace
  6. Later, close “Find and Replace” dialog box.
  7. After returning to message body, press “Alt + F9” keys again to hide hyperlink addresses.
  8. Subsequently, press “Ctrl + A” to select all message body.
  9. Finally, tap on “F9” key to update all the changed hyperlink addresses.
  10. Now, check the hyperlink addresses by letting cursor hover above the texts. All the hyperlinks that are linked to the old addresses have been altered, like the following screenshot.Changed Hyperlinks' Addresses

Method 2: Make Use of Outlook VBA

  1. In the first place, press “Alt + F11” to launch VBA editor.
  2. Then, in the new window, enable “MS Word Object Library” according to the article “How to Add an Object Library Reference in VBA“.
  3. Next, put the following VBA code into a module.
Sub BatchChangeMultipleHyperlinkAddresses()
    Dim objMail As Outlook.MailItem
    Dim objMailDocument As Word.Document
    Dim objHyperlink As Word.Hyperlink
    Dim strOldAddress, strNewAddress As String
    Dim i As Long
 
    Set objMail = Application.ActiveInspector.CurrentItem
    Set objMailDocument = objMail.GetInspector.WordEditor
 
    If objMailDocument.Hyperlinks.Count > 0 Then
       'Enter the old and new hyperlink address
       strOldAddress = InputBox("Enter the old hyperlink address:")
       strNewAddress = InputBox("Enter the new hyperlink address:")
  
       'Change hyperlink address
       i = 0
       For Each objHyperlink In objMailDocument.Hyperlinks
           If InStr(objHyperlink.Address, strOldAddress) > 0 Then
              objHyperlink.Address = Replace(objHyperlink.Address, strOldAddress, strNewAddress)
              i = i + 1
           End If
       Next
 
       'Prompt you
       MsgBox i & " hyperlinks' addresses are changed!", vbInformation + vbOKOnly
    End If
End Sub

VBA Code - Batch Change Multiple Hyperlinks' Addresses

  1. Afterwards, add this macro to Quick Access Toolbar of message window with reference to “How to Run VBA Code in Your Outlook“.
  2. Eventually, follow the steps below to try it.
  • In the popup dialog boxes, enter the old and new hyperlink addresses.Enter Old and New Addresses
  • When macro finishes, you will receive a message telling you the number of hyperlinks whose addresses have been changed.Prompt
  • Multiple hyperlinks’ addresses have been changed, like the image below.Multiple Hyperlinks' Addresses Are Changed

Safeguard Your Valuable Outlook Data

Since Outlook is prone to errors and corruption, you have to make some effective precautions to safeguard your Outlook file. First of all, you need to make regular PST data backups. Also, you ought to build a good habit of closing your Outlook in a proper way. Last but not least, you are better off preparing a potent Outlook fix utility, such as DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including SQL Server recovery and outlook repair software products. For more information visit www.datanumen.com

Leave a Reply

Your email address will not be published. Required fields are marked *