#1
|
|||
|
|||
Address lost when I replace display text in URLs
Greetings Forum
I have been trying to troubleshoot this on my own for two days, trying various tricks I found online and finally gave up. I am attempting to replace the display text of URLs in a Word document (see attachement 1.png, upper) from "http://dx.doi....." to "Full Text", while retaining the underlying link. I am using the following wild card string: http?*^032 to select the text to be replaced (every link is followed by a paragraph mark). It selects the entire hyperlink, but the replace operation removes the URL (see attachement 1.png, lower). I thought it might be because I was replacing with two separate words (Full Text), but the same thing happens when replacing with a single word. No idea what to do at this point. Thanks for any insight the forum can offer. nmk |
#2
|
||||
|
||||
You can't use Find/Replace for changing the display text of URLs - you need to edit the hyperlink's display text property. You could automate that with a macro such as:
Code:
Sub Demo() Application.ScreenUpdating = False Dim Hlnk As Hyperlink For Each Hlnk In ActiveDocument.Hyperlinks With Hlnk If InStr(.TextToDisplay, "http://dx.doi") > 0 Then .TextToDisplay = Split(.TextToDisplay, "http://dx.doi")(0) & "Full Text" End If End With Next Application.ScreenUpdating = True End Sub For Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with display text for URLs in template | noeyeddeer | Word VBA | 13 | 10-30-2014 11:43 PM |
Mass Change of Text to Display in Hyperlink to actual address | ItsChris | Excel | 3 | 10-18-2014 01:35 PM |
Mail Merge Many URLs in one email by common email address | instantaphex | Mail Merge | 3 | 04-29-2013 05:46 PM |
Lost address book name | kaygeea | Outlook | 0 | 10-31-2011 05:45 PM |
Macro to replace From Address in Outlook | RlcZek113524 | Outlook | 0 | 06-08-2011 02:20 PM |