How to Batch Copy All Hyperlinks in Multiple Emails to a New Outlook Email

If you want to copy all hyperlinks in multiple emails and then send them in a new email to someone else, you can use the approach introduced in this article. It is able to let you get this in one go.

At times, you may need to extract and send the hyperlinks from multiple received emails to a specific email address. For instance, your colleague sends you some emails that contain hyperlinks related to an ongoing project. Then, you would like to extract these hyperlinks to a single email and send this email to your other email address. In this case, the most direct way is to copy hyperlinks to the new email one by one from the source emails. But, it is too stupid and inefficient. Now, thereinafter, we will share you a more convenient and quick method.

Batch Copy All Hyperlinks in Multiple Emails to a New Email

  1. At the very outset, launch Outlook application.
  2. Then, select the emails from which you want to extract hyperlinks.Select Source Emails
  3. Next, trigger Outlook VBA editor according to “How to Run VBA Code in Your Outlook“.
  4. In the VBA editor window, enable the reference to “MS Word Object Library” as per “How to Add an Object Library Reference in VBA“.
  5. Later, put the following code into a module.
Sub CopyAllHyperlinksOfMultipleEmails()
    Dim objNewMail As Outlook.MailItem
    Dim objNewMailDocument As Word.Document
    Dim objSelection As Outlook.Selection
    Dim objMail As Outlook.MailItem
    Dim objMailDocument As Word.Document
    Dim objHyperlink As Word.Hyperlink
 
    'Create a new mail
    Set objNewMail = Outlook.Application.CreateItem(olMailItem)
    objNewMail.Display
    Set objNewMailDocument = objNewMail.GetInspector.WordEditor
 
    'Get all selected emails
    Set objSelection = Outlook.Application.ActiveExplorer.Selection
 
    For i = objSelection.Count To 1 Step -1
        If objSelection.Item(i).Class = olMail Then
           Set objMail = objSelection.Item(i)
 
           Set objMailDocument = objMail.GetInspector.WordEditor
 
           'Copy hyperlink to new mail body
           For Each objHyperlink In objMailDocument.Hyperlinks
               objHyperlink.Range.Copy
               objNewMailDocument.Range(0, 0).PasteAndFormat wdFormatOriginalFormatting
               objNewMailDocument.Range(0, 0).Select
               objNewMailDocument.Application.Selection.TypeParagraph
           Next
        End If
    Next
End Sub

VBA Code - Batch Copy All Hyperlinks in Multiple Emails to a New Email

  1. After that, press “F5” to run this macro right now.
  2. Finally, when macro completes, a new mail will show up, which is containing all the hyperlinks extracted from the previously selected emails.Copied Hyperlinks in New Email

Pay Special Attention to Unknown Hyperlinks

It is especially necessary for Outlook users to beware of all suspicious hyperlinks in unknown emails. It is because that most of them may carry viruses, which can directly result in Outlook data corruption. Obviously, no one is ready to lose their Outlook data. Hence, in daily work, you ought to watch out for the unknown mails, preventing viruses and malware. Plus, if possible, it is suggested to get hold of an experienced and reliable Outlook repair tool, such as DataNumen Outlook Repair. It will surely help you a lot when your Outlook PST file gets compromised.

Author Introduction:

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

One response to “How to Batch Copy All Hyperlinks in Multiple Emails to a New Outlook Email”

Leave a Reply

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