Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-02-2015, 01:01 PM
nmckenna nmckenna is offline Address lost when I replace display text in URLs Windows 7 64bit Address lost when I replace display text in URLs Office 2010 64bit
Novice
Address lost when I replace display text in URLs
 
Join Date: Oct 2015
Posts: 1
nmckenna is on a distinguished road
Default 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
Attached Images
File Type: png 1.png (23.1 KB, 10 views)
Reply With Quote
  #2  
Old 10-02-2015, 05:10 PM
macropod's Avatar
macropod macropod is offline Address lost when I replace display text in URLs Windows 7 64bit Address lost when I replace display text in URLs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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 PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Address lost when I replace display text in URLs 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

Other Forums: Access Forums

All times are GMT -7. The time now is 03:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft