Replace LINK text
-
- BronzeLounger
- Posts: 1258
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Replace LINK text
How do I replace the displayed text in links (in a Word 2003) document? There are all different links with text like "Click here", I want that to be changed into e.g. "Link"
-
- Administrator
- Posts: 78604
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Replace LINK text
Can't you simply enter Click Here in the Find what box and Link in the Replace with box in the Replace dialog? Or is that too naive?
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1258
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Replace LINK text
That's what I did but that didn't work...
-
- Administrator
- Posts: 78604
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Replace LINK text
In what way did it fail? I tried it just now and it worked flawlessly (I have to admit that the text "Click here" didn't occur elsewhere in the document).
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 508
- Joined: 17 Dec 2010, 03:14
Re: Replace LINK text
Hi ErikJan,
Try something like:
Try something like:
Code: Select all
Sub EditHyperlinkDisplayText()
Dim oHLNK As Hyperlink
For Each oHLNK In ActiveDocument.Hyperlinks
On Error Resume Next
oHLNK.Range.Select
oHLNK.TextToDisplay = InputBox("Change Display Text?", "Hyperlink Display Text Editor", oHLNK.TextToDisplay)
Next
End Sub
Paul Edstein
[Fmr MS MVP - Word]
[Fmr MS MVP - Word]
-
- BronzeLounger
- Posts: 1258
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Replace LINK text
Nothing found to replace... (and yes, I also copied the text-to-replace and pasted in into the 'find' box to make sure there were no typo's)HansV wrote:In what way did it fail? I tried it just now and it worked flawlessly (I have to admit that the text "Click here" didn't occur elsewhere in the document).
-
- Administrator
- Posts: 78604
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Replace LINK text
I don't know why it doesn't work for you. See if macropod's macro does what you want.
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1258
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Replace LINK text
I used the code snippet, modified it a little to find only the text I was looking for and immediately replace that with the new text. That did work out fine. Thanks for the help!