You can do a Copy Hyperlink on an existing hyperlink, but you can not put that into Replace.
You are not being completely clear. Is this the SAME text that is being replaced? Is this different text, but wanting the SAME hyperlink? In other words, different display text, but same target?
There may be a way to trick Replace to do it, but I don't kniow it.
If you are trying the replace the
same text throughout the document, with the
same hyperlink, then what you CAN do though, is this.
Make one chunks of text have the hyperlink. Say the text is "To Ebay", and the target is "http:\\ebay.com" - and this of course could be anything, including another document, or a bookmark within the document.
Right click the hyperlink you just added, select Copy Hyperlink, then run the following code as a macro. Replace values as needed.
Code:
Sub PasteHyperlink()
Selection.HomeKey Unit:=wdStory
With Selection.Find
Do While _
(.Execute(Findtext:="To Ebay", Forward:=True) _
= True) = True
Selection.Paste
Loop
End With
End Sub
It will paste the hyperlink values to all found text ("To Ebay").
This could be expanded to allow variables to the search text. It could also be pumped up to grab the original hyperlink values. There is very possibly a better way (there often is), but I did this as quick and dirty.
Gerry
My paintings and sculpture