Note: The other languages of the website are Google-translated. Back to English

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

Extract all hyperlinks addresses with VBA

Copy all hyperlinks or only addresses to clipboard with Kutools for Wordgood idea3


arrow blue right bubble 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 word, if there are pictures with hyperlinks, this VBA code cannot work.


arrow blue right bubble Extract all hyperlinks addressesith 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 hyperlinks 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.


arrow blue right bubble 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.

Kutools for Word, with more than
100
 handy functions, makes your jobs easier. 

After installing Kutools for Word, please do as below:(Free Download Kutools for Word Now!)

1. Click Kutools Plus > Copy Hyperlink.
doc copy hyperlinks 1

2. In the popping dialog, choose one option as you need.
doc copy hyperlinks 2

Now, select one location you want to place the hyperlinks, press Ctrl + V to paste them.

Copy and paste hyperlinks
doc copy hyperlinks 3
Copy and paste hyperlink address
doc copy hyperlinks 4

Tabbed browsing & editing multiple Word documents/Excel workbooks as Firefox, Chrome, Internet Explore 10!

You may be familiar to view multiple webpages in Firefox/Chrome/IE, and switch between them by clicking corresponding tabs easily. Here, Office Tab supports similar processing, which allow you to browse multiple Word documents or Excel workbooks in one Word window or Excel window, and easily switch between them by clicking their tabs.
Click for free trial of Office Tab!

Browse multiple word documents in one window as Firefox

Relative Articles:


Recommended Word Productivity Tools

 

Kutools For Word - More Than 100 Advanced Features For Word, Save Your
50%
Time

  • Complicated and repeated operations can be done one-time processing in seconds.
  • Insert multiple images across folders into Word document at once.
  • Merge and combine multiple Word files across folders into one with your desired order.
  • Split the current document into separate documents according to heading, section break or other criteria.
  • Convert files between Doc and Docx, Docx and PDF, collection of tools for common conversions and selection, and so on...
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Omg this is legendary stuff. So helpful. Thanks a lot! :-)
This comment was minimized by the moderator on the site
wow, its great. Thank you so much
This comment was minimized by the moderator on the site
it is prompting " Compile Error: Syntax Error" Please help me, I need to do a lot of work using this .Reply asap
This comment was minimized by the moderator on the site
Indeed! ONE year later, am having similar issues and totally bawled over by your wonderful help!! God Bless YOu!!
This comment was minimized by the moderator on the site
Thank you. Just what I needed to parse a document.
This comment was minimized by the moderator on the site
Excellent! It helped me extract some links from an html file that I opened with Word (Excel was discarding some links). Here is the modified code so that a csv file could be built that could be further used. [quote]SubGetAllHyperlinks() ' Updateby20160504 ' https://www.extendoffice.com/documents/word/1411-word-select-copy-all-hyperlinks.html+&cd=1&hl=en&ct=clnk&gl=us<br /> 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.InsertAfter (oLink.TextToDisplay) rng.InsertAfter (", ") rng.InsertAfter (oLink.Address) rng.InsertAfter (vbCrLf) Next docNew.Activate Application.ScreenUpdating = True Application.ScreenRefresh End Sub[/quote]
This comment was minimized by the moderator on the site
Thank you very much for this script. This helped me to extract 5K links. Thank you very much.
This comment was minimized by the moderator on the site
This code works fine to me. The two on examples in the article description don't. Thanks a lot and my best regards.
This comment was minimized by the moderator on the site
This is great stuff! Many thanks. What changes do I need to make to GetAllHyperlinks() for the following case? -- original document contains both normal text and links -- result wanted: same document but each link is followed by a space and the URL Thanks
This comment was minimized by the moderator on the site
Can I get the same script to run in outlook?
This comment was minimized by the moderator on the site
Height of Legendary, thanks a million
This comment was minimized by the moderator on the site
I am amazed. That's gold. You saved me a ton of work.
This comment was minimized by the moderator on the site
Thank you so much! This was exactly what I was looking for!
This comment was minimized by the moderator on the site
Impresionante! Millón de gracias.Me has acercado a la solución muchísimo pero si fuera posible copiarlos en la fila 1 de un excel ya creado sería impresionante. Es para aplicarles una formula que separa los links del texto.Un saludo y un millón de gracias!!!

This comment was minimized by the moderator on the site
How can we export word file hyperlinks and it's Text display to an excel file ? 
This comment was minimized by the moderator on the site
Good information! It assisted me in extracting links from an html file I had opened in Word. Refer to <a href="https://cookieclicker2.io">cookie clicker</a> is idea new.
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations

Follow Us

Copyright © 2009 - www.extendoffice.com. | All rights reserved. Powered by ExtendOffice. | Sitemap
Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.
Protected by Sectigo SSL