collecting together hyperlinks in word document

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

Guest

I want to collect together a large number of hyperlinks to use in a
"sources" section of a report.
I have used a style sheet and hyperlinks appear in the style sheet, but
unlike all my other styles I cannot select all other similar hyperlinks - it
only ever says there is the one formatted item in the hyperlink style,
whichever hyperlink I click on and try to collect.
 
Use the following code to insert a copy of them at the end of the document:

Dim hlink As Field, hrange As Range

For Each hlink In ActiveDocument.Fields
If hlink.Type = wdFieldHyperlink Then
Set hrange = hlink.Code
ActiveDocument.Range.InsertAfter Mid(hrange, 13, Len(hrange) - 14) &
vbCr
End If
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
 
Thanks.
I guess this is using Word as I haven't before. How and where do I put these
codes?
 

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