How to select and copy all hyperlinks from a Word document?
In some cases, you have a long document with multiple hyperlinks existing in, and you only need to copy all the hyperlinks at once from this document and then paste them to another one. Is there any way can quickly copy all of them at once instead of copying them one by one?
Copy all hyperlinks with VBA
1. Open the Word document which you want to copy the hyperlinks, and press Alt + F11 to open the Microsoft Visual Based Application Window.
2. Click Insert > Module, and copy the following VBA into the Window.
VBA: Copy all hyperlinks
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 run the VBA code. Then all the hyperlinks are copied to a new document. You can save the new document later. You can see the result as follows.
Note: This VBA only can run when all the hyperlinks are linked with text, if there are pictures with hyperlinks, this VBA code cannot work.
Extract all hyperlink addresses with VBA
1. Open the Word document which you want to extract the hyperlinks, and press Alt + F11 to open the Microsoft Visual Based Application Window.
2. Click Insert > Module, and copy the following VBA into the Window.
VBA: Extract all hyperlink addresses
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 to run the VBA code. Then all the hyperlinks addresses are extracted in a new document, you can save it later.
Note: The extract hyperlinks address are not in the original order.
Copy all hyperlinks or only addresses to clipboard with Kutools for Word
If you want to copy all hyperlinks or only addresses to clipboard from Word document easily and quickly, the Copy Hyperlink utility of Kutools for Word can do you this favor.
After installing Kutools for Word, please do as below:
1. Click Kutools Plus > Copy Hyperlink.
2. In the popping Copy all hyperlinks to clipboard dialog, choose one option as you need.
Now, select one location you want to place the hyperlinks, press Ctrl + V to paste them.
Copy and paste hyperlinks |
Copy and paste hyperlink addresses |
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! |
Related Articles:
- Insert, remove and list all hyperlinks of current document in Word
- Insert multiple hyperlinks to a document in Word
- Remove all hyperlinks in Word
Best Office Productivity Tools
Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!
🤖 Kutools AI Features: Generate Content / Rewrite Text / Document Q&A / Get Quick Answers / Translate documents / Polish Document (Preserve Format)...
📘 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...
Best Office Productivity Tools
Kutools for Word - 100+ Tools for Word
- 🤖 Kutools AI Features: Generate, Rewrite, Summarize, Translate Documents / Get Quick Answers / Polish Document (Preserve Format)
- 📘 Document Mastery: Split Pages / Merge Documents / Batch Convert to PDF
- ✏ Contents Editing: Batch Find and Replace / Resize All Pictures
- 🧹 Effortless Clean: Remove Extra Spaces / Remove Section Breaks
- ➕ Creative Inserts: Insert Thousand Separators / Insert Check Boxes / Create QR Codes