Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink in MS Word

Status
Not open for further replies.

hugh999

MIS
Nov 29, 2001
129
IE
Hi

I have a large MS word 2003 document that contains over 30 hperlinks that when clicked bring you to a location within the document. As this document Continually gets updated i have to manualy test eack link to verify it goes to the correct location.

I would like to automate this procedure if possible so the hyperlink text and the location text gets copied to a text file where i can view the results.

Any help appreciated.

Thanks
 
Here's some VB for you:
Open "c:\Doc_Hyperlinks.txt" For Output As #1
For Each Doc_Hyper In ActiveDocument.Hyperlinks
Write #1, Doc_Hyper.Address, Doc_Hyper.Name
Next Doc_Hyper
Close #1

Simon Rouse
 
Thanks Simon for your help

Your code displays the Destination text, but not the hyperlink name, the text file shows the hyperlink name as " " only.

Thanks
 
Doc_Hyper.Name is the name. If you mean what appears in the Word document, that would be [blue]Doc_Hyper.TextToDisplay [/blue]. But you need the Name/Address to check the location of the link.
 
Hi Simon

Using the following code works great.
Write #1, Doc_Hyper.TextToDisplay, Doc_Hyper.name

Thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top