Skip to main content

Kutools for Office β€” One Suite. Five Tools. Get More Done.

How to select and copy all hyperlinks from a Word document?

Author Sun Last modified

If you have a long Word document with multiple hyperlinks and need to copy them all at once, manually selecting each one can be time-consuming. Fortunately, there are efficient ways to extract and copy all hyperlinks or just their addresses. This guide will introduce different methods to accomplish this quickly.


Copy all hyperlinks to a new document using VBA

Using VBA, you can extract all hyperlinks from a document and copy them into a new document.

  1. Open the Word document containing the hyperlinks and press Alt + F11 to open the Microsoft Visual Basic for Applications window.
  2. Click Insert > Module, then copy and paste the following VBA code into the module window:
    Sub HyperlinksExtract()
    'Updateby20140214
        Dim oLink As Hyperlink
        Dim docCurrent As Document 'current document
        Dim docNew As Document 'new document
        Dim rngStory As StoryRanges
        Set docCurrent = ActiveDocument
        Set docNew = Documents.Add
        For Each oLink In docCurrent.Hyperlinks
            oLink.Range.Copy
            docNew.Activate
            Selection.Paste
            Selection.TypeParagraph
        Next
        
        Set docNew = Nothing
        Set docCurrent = Nothing
    End Sub
    
  3. Click the Run button to execute the VBA code. A new document will open containing all hyperlinks from the original document.
    Document with text with hyperlinks >>> New document with only text with hyperlinks

Note: This VBA method works only for text-based hyperlinks. It does not extract hyperlinks embedded in images.


Extract only hyperlink addresses (plain text) to a new document using VBA

This VBA method extracts only the hyperlink addresses from a document and pastes them into a new document.

  1. Open the Word document and press Alt + F11 to open the VBA editor.
  2. Click Insert > Module, then copy and paste the following VBA code:
    Function GetAllHyperlinks()
    'Updateby20140214
        Dim docCurrent As Document
        Dim docNew As Document
        Dim oLink As Hyperlink
        Dim rng As Range
        Application.ScreenUpdating = False
        Set docCurrent = ActiveDocument
        Set docNew = Documents.Add
        For Each oLink In docCurrent.Hyperlinks
            Set rng = docNew.Range
            rng.Collapse
            rng.InsertParagraph
            rng.InsertAfter (oLink.Address)
        Next
        docNew.Activate
        Application.ScreenUpdating = True
        Application.ScreenRefresh
    End Function
    
  3. Click the Run button. A new document will be created containing only the hyperlink addresses (plain text).
    Document with text with hyperlinks >>> New document with only hyperlink addresses

Note: The extracted hyperlink addresses may not appear in the same order as in the original document.


Copy hyperlinks or addresses to clipboard using Kutools for Word

Kutools for Word provides a simple way to copy all hyperlinks or just their addresses to the clipboard with a few clicks.

Kutools for Word, equipped with AI πŸ€–, offers over 100 handy features to simplify your tasks.
  1. Click Kutools Plus > Copy Hyperlink.
    Copy Hyperlink button on the Kutools tab on the ribbon
  2. In the Copy all hyperlinks to clipboard dialog box, select the desired option.
    Copy all hyperlinks to clipboard dialog box
  3. Paste the copied hyperlinks wherever you want by pressing Ctrl + V.
  • If you select the Hyperlinks option, both the display text and the hyperlink will be copied.
    Text with hyperlinks pasted
  • If you select the Hyperlink Addresses option, only the hyperlink address will be copied as plain text.
    Hyperlinks addresses pasted
Kutools for Word is the ultimate Word add-in that streamlines your work and boosts your document processing skills. Get It Now!

Demo: Copy All Hyperlinks in a Word Document

Discover the Kutools / Kutools Plus tab in this video from Kutools for Word. Enjoy 100+ features and permanently free AI utilities. Download now!


Tabbed Browsing & Editing for Multiple Word Documents/Excel Workbooks, Just Like in Chrome and Edge!

Just like browsing multiple webpages in Chrome, Safari and Edge, Office Tab lets you open and manage multiple Word documents or Excel workbooks in one Word window or Excel window. Switching between documents or workbooks is now simple with a click on their tabs!

Try Office Tab for free now!


Related Articles:

Best Office Productivity Tools

Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!

πŸ€– Kutools AI Features: AI Assistant / Real-Time Assistant / Super Polish (Preserve Format) / Super Translate (Preserve Format) / AI Redaction / AI Proofread...

πŸ“˜ Document Mastery: Split Pages / Merge Documents / Export Selection in Various Formats (PDF/TXT/DOC/HTML...) / Batch Convert to PDF...

✏ Contents Editing: Batch Find and Replace across Multiple Files / Resize All Pictures / Transpose Table Rows and Columns / Convert Table to Text...

🧹 Effortless Clean: Sweap away Extra Spaces / Section Breaks / Text Boxes / Hyperlinks / For more removing tools, head to the Remove group...

βž• Creative Inserts: Insert Thousand Separators / Check Boxes / Radio Buttons / QR Code / Barcode / Multiple Pictures / Discover more in the Insert group...

πŸ” Precision Selections: Pinpoint Specific Pages / Tables / Shapes / Heading Paragraphs / Enhance navigation with more Select features...

⭐ Star Enhancements: Navigate to Any Location / Auto-Insert Repetitive Text / Toggle Between Document Windows / 11 Conversion Tools...

🌍 Supports 40+ Languages: Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Kutools and Kutools Plus tabs on the Word Ribbon
πŸ‘‰ Want to try these features? Download Kutools for Word now! πŸš€
 

✨ Kutools for Office – One Installation, Five Powerful Tools!

Includes Office Tab Pro Β· Kutools for Excel Β· Kutools for Outlook Β· Kutools for Word Β· Kutools for PowerPoint

πŸ“¦ Get all 5 tools in one suite | πŸ”— Seamless integration with Microsoft Office | ⚑ Save time and boost productivity instantly

Best Office Productivity Tools

Kutools for Word - 100+ Tools for Word