Can I export hyperlinks from a word document to a simple list?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a client-supplied document of over fifty pages with many, many links.
I need to place these links into a design (Quark) layout. Can I export all of
the links in the document into a simple listing rather than picking through
all the copy paragraph by paragraph to copy and paste links?
 
Run this code --

Sub Macro1

Dim pLink As Word.Hyperlink

For Each pLink In ActiveDocument.Hyperlinks
ActiveDocument.Content.InsertAfter pLink.Address & vbCr
Next

End Sub


This will insert a list of all the hyperlinks at the end of the document.
Then you can cut and paste from there.
 
Run a macro containing the following code when the document containing the
hyperlinks is the active document and it will create a new document
containing a list of the hyperlinks:

Dim source As Document, target As Document, hlink As Hyperlink

Set source = ActiveDocument
Set target = Documents.Add
For Each hlink In source.Hyperlinks
target.Range.InsertAfter hlink.Address & vbCr
Next hlink


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top