is there an easy way to find bad links in a document

G

GaryJ

I get an error message when I open a document. Says there are links in the
document that are broken or files can not be found which are the source of
the link. Is there a way to get word to display which links are not working?
I have more than 20 links in the doc to spread sheets and other documents
and tracking down the bad link is not easy.
 
C

champollion.yves

I would cycle through all fields, check whether the field type is a
hyperlink, if so update it. If the update fails, the hyperlink has a
problem. here is the routine:

Sub CheckLinks()
Dim oMyField As Field
For Each oMyField In ActiveDocument.Fields
If oMyField.Type = wdFieldHyperlink Then
If Not oMyField.Update Then
'here is a faulty link
End If
End If
Next
End Sub

Cheers,
Yves Champollion
www.champollion.net
 

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

Top