Help to create a Word macro to change re-named Hyperlinks back to their full web address? (1 Viewer)

in7el

New member
Local time
Today, 23:11
Joined
Jul 29, 2020
Messages
2
There are reports written in word, which have a macro to rename the hyperlinks in the footnotes to say "URL" for example. This is done in order to decrease the size of the document itself.

My question was if someone is able to help me reverse this procedure and create a macro to actually change the renamed hyperlinks back to their full web address.

I am able to do this manually to each one by going to edit the hyperlink and removing the "URL" title. This changes the "URL" name back to the original full web address.

I have tried to record a macro of highlighting the "URL" hyperlinks and editing this way but it only goes from a specific range and doesn't actually change the name of the hyper.

Below I will provide the macro and hopefully, someone is able to assist me with this. I'm not sure what to put in the new name " " field, if I leave it blank it doesn't work.

______________________________________________________

Sub hyperlinks()
Dim IngTemp As Long
For IngTemp = 1 To Selection.hyperlinks.Count
Selection.hyperlinks(IngTemp).TextToDisplay = "url" <<< This is the field im unsure what to put

Next
End Sub
 

namliam

The Mailman - AWF VIP
Local time
Today, 22:11
Joined
Aug 11, 2003
Messages
11,696
Untestested, but maybe:
Selection.hyperlinks(IngTemp).TextToDisplay = ""
 

in7el

New member
Local time
Today, 23:11
Joined
Jul 29, 2020
Messages
2
Untestested, but maybe:
Selection.hyperlinks(IngTemp).TextToDisplay = ""

Thanks I tried that unfortunately it does not work.
 

Gasman

Enthusiastic Amateur
Local time
Today, 21:11
Joined
Sep 21, 2011
Messages
14,047
You're welcome BTW
 

Users who are viewing this thread

Top Bottom