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.
Method 1: Find and Replace Manually
- To begin with, in the opened email, press “Alt + F9” key buttons.
- Then, all the hyperlinks’ addresses will be shown directly.
- Now, press “Ctrl + H” to bring out the “Find and Replace” dialog box.
- In this new dialog box, input the old hyperlink address in “Find what” box and new address in “Replace with” box.
- After that, click “Replace All” button.
- Later, close “Find and Replace” dialog box.
- After returning to message body, press “Alt + F9” keys again to hide hyperlink addresses.
- Subsequently, press “Ctrl + A” to select all message body.
- Finally, tap on “F9” key to update all the changed hyperlink addresses.
- 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.
Method 2: Make Use of Outlook VBA
- In the first place, press “Alt + F11” to launch VBA editor.
- Then, in the new window, enable “MS Word Object Library” according to the article “How to Add an Object Library Reference in VBA“.
- 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
- Afterwards, add this macro to Quick Access Toolbar of message window with reference to “How to Run VBA Code in Your Outlook“.
- Eventually, follow the steps below to try it.
- In the popup dialog boxes, enter the old and new hyperlink addresses.
- When macro finishes, you will receive a message telling you the number of hyperlinks whose addresses have been changed.
- Multiple hyperlinks’ addresses have been changed, like the image below.
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