Consulting

Results 1 to 2 of 2

Thread: Help to create a Word macro to change re-named Hyperlinks back to their full web addr

  1. #1
    VBAX Newbie
    Joined
    Jul 2020
    Posts
    1
    Location

    Help to create a Word macro to change re-named Hyperlinks back to their full web addr

    Hi hoping someone can help me with this its been going on for days now and I cannot seem to find a solution.

    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

  2. #2
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •